Jump to:

22977 Posts in 11722 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Best Way to implement a lightbox feature

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 2
Go to End
Author Topic: 2148 Views
  • arthurdent
    Avatar
    Community Member
    132 Posts

    Re: Best Way to implement a lightbox feature Link to this post

    <embarassed>OK -- I was missing a script or two</embarassed>

    So now I've locked and loaded the following:

    class Page_Controller extends ContentController {
       public static $allowed_actions = array(
       );

       public function init() {
          parent::init();
          Requirements::javascript(THIRDPARTY_DIR.'/jquery/jquery.min.js'); //include jquery bundled with ss
          Requirements::javascript('themes/'. SSViewer::current_theme() .'/javascript/lightbox.js'); //link to js file in current theme folder
          Requirements::javascript('themes/'. SSViewer::current_theme() .'/javascript/effects.js');
          Requirements::javascript('themes/'. SSViewer::current_theme() .'/javascript/prototype.js');
          Requirements::javascript('themes/'. SSViewer::current_theme() .'/javascript/scriptaculous.js');
          Requirements::javascript('themes/'. SSViewer::current_theme() .'/javascript/builder.js');
       }
    }

    I now have two instances of builder.js and effects.js showing up -- but lightbox still isn't working... ?

  • IOTI
    Avatar
    Community Member
    187 Posts

    Re: Best Way to implement a lightbox feature Link to this post

    Any luck getting it to work?

    If you're still having issues, I would try limiting your Requirements to just the files you need for the lightbox to work (which i'm guessing are jquery.min.js and lightbox.js).

    Some other considerations:

    1. Are you also firing a script to initialize the lightbox? (assuming lightbox.js is a js library).
    2. Do you have the correct css class on your links in the template?
    3. When you click a link that is suppose to open a lightbox, are there any errors in firebug/chrome developer tools?

    2148 Views
Page: 1 2
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.