Think I have the javascript files added correctly now, and now I get another error..
$("ul.gallery").galleria is not a function
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Think I have the javascript files added correctly now, and now I get another error..
$("ul.gallery").galleria is not a function
Try the following:
<script type="text/javascript">
;(function($) {
$(function(){
$('ul.gallery').galleria();
});
})(jQuery);
</script>
same error..
Are you sure all files are being included and loaded correctly? Best way to check this is probably the "Net" tab in firebug. Also make sure you don't include files twice (via Requirements::javascript and/or directly in code).
yes, have checked the firebug net and it says that they are being added correctly, and no they are not included twice..
But still get "jQuery is not defined" error.
Did a quick search online and found someone that wrote:
"jQuery 1.3.2 no longer uses the @ convention and this is why galleria is choking. The simple fix to make Galleria work with jQuery 1.3.2 is to open your galleria.js file and replace all occurrences of @rel with rel"
Tried to find the @rel, but that must have been fixed..?
Or you could use jQuery 1.2.6: http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js
No, that didn't work. Have tried the other version of jQuery to, but still get the same error message.
This is starting to get a little frustrating..
Here's how I have added it:
In page.php (firebug says it loads fine, and yes I did try to add those in page.ss head tag to):
Requirements::javascript("themes/tutorial/js/jquery.galleria.js");
Requirements::javascript("themes/tutorial/js/jquery.min.js");
In articlepage.ss
<ul class="gallery">
<% control Attachment %>
<li><a href="$SetWidth(470).Link" title="$Title">$SetWidth(70)</a></li>
<% end_control %>
</ul>
As far as I can see in the usage part on the galleria website, you only need to add ul class gallery and add the images in a il list.