Jump to:

23371 Posts in 18161 Topics by 2865 members

General Questions

SilverStripe Forums » General Questions » Requirements not loading

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 545 Views
  • voodoochile
    Avatar
    Community Member
    52 Posts

    Requirements not loading Link to this post

    ok so i have been scratching my head over this for awhile, i am trying to get colorbox working within a dataobject and i'm really not sure whats going wrong it all works up to the point where i click on the image to view it.
    so far the only reason i can see for it not working is that 2 of the required javascript and css files for colorbox; are not loading the 3rd and a custom script are loading?
    i have checked the paths etc and these are all correct, if i type in the full path eg Http://blah/blahblah/etc the files load but don't work.

  • FullWebService
    Avatar
    Community Member
    38 Posts

    Re: Requirements not loading Link to this post

    I use colorbox a lot and have no problems with it.

    I load the files with:

       
    Requirements::themedCSS('colorbox');
    Requirements::javascript('themes/'.SSViewer::current_theme().'/js/jquery.colorbox-min.js');

    The colorbox css file is in /themes/theme_name/css/ and the js file in /themes/theme_name/js/.

    The image files I put in /themes/theme_name/images/colorbox/.

    Then I search and replace url(images/ with url(../images/colorbox/ in the colorbox.css file.

  • Sticks
    Avatar
    Community Member
    29 Posts

    Re: Requirements not loading Link to this post

    I had a similar problem with Colorbox. The solution for me was to add a no conflict line at the beginning of the Colorbox js file:

    jQ = jQuery.noConflict();

    I then changed all the $ to jQ (although not the $ in the regular expressions) and it worked fine after that. You need to make sure you call jQuery before Colorbox as well in your _config.php.

  • voodoochile
    Avatar
    Community Member
    52 Posts

    Re: Requirements not loading Link to this post

    Hi and Thanks for the replies

    Fullwebservice - your reply helped a great deal, thanks i finaly got it working using your solution after messing around a little.
    after i got the files loading using your method it still wasn't working a little more searching and i found i also had the requirements loading in the wrong order ... overall i am stoked to get this going although i am wanting to make this into a module so i will have to play around a little more, at least now i know it works as i had envisiged .. thank you.

    Sticks - thank you for your reply, i did see a thread ( may have been yours) regarding this when i was trouble shooting after i got the Requirements to load i thought too this may have been an issue as it turns out i just needed to have the requirements load in the correct order, i still have the $ in the code and it works fine.

    so once again thank you for your help

    545 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.