3217 Posts in 853 Topics by 812 members
| Go to End | ||
| Author | Topic: | 7057 Views |
-
Re: fancybox or shadowbox not showing

6 June 2011 at 11:26pm
hmmm yes that makes sense on a normal html static website but since in silverstripe the JS on my template is described like this:
<% require javascript(mysite/javascript/shadowbox-3.0.3/shadowbox.js) %>
where do I put the init()???
sorry for being so clueless!!
-
Re: fancybox or shadowbox not showing

7 June 2011 at 12:00am Last edited: 7 June 2011 12:03am
Hmmm, you could write the code directly to your template beneath your <% require ... %> ...
or you could create a javascript file called "shadowbox_setup.js" in /mysite/javascript, write Shadowbox.init(); to it, and require this file in your template :<% require javascript(mysite/javascript/shadowbox-3.0.3/shadowbox.js) %>
<% require javascript(mysite/javascript/shadowbox_setup.js) %>
...
or you delete these <% require ...%> thingies from the template and add this to the init() method of the Controller class of the Page type:function init() {
parent::init();
Requirements::javascript('mysite/javascript/shadowbox-3.0.3/shadowbox.js');
Requirements::customScript('<script type="text/javascript">Shadowbox.init();</script>');
}^^Hope this is somewhat understandable, cause we have a nice party going on and i allready had some beer
Cheers
-
Re: fancybox or shadowbox not showing

7 June 2011 at 12:31am
aaaaaah thank you so much!!! the first method did the trick...however not until after I noticed that I forgot to include the shadowbox.css as well....now that this is solved it finally works!!
thanks so much! You´ve always been a great help (especially when drunk ;-)
have a nice party!PROST!
| 7057 Views | ||
| Go to Top |


