Jump to:

23459 Posts in 18906 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » sIFR and Lightbox2.0 conflict on ss2.4

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: 1162 Views
  • Codenz
    Avatar
    Community Member
    6 Posts

    sIFR and Lightbox2.0 conflict on ss2.4 Link to this post

    Hi. This is my first post so please be gentle.
    I'm using sIFR on SS2.4 and it all works sweet. I've created a custom gallery style page that utilises the FileDataObjectManager and that all works sweet to.
    But they don't work so well together. For some reason SIFR drops off and won't display.
    I've hard coded the js into the ss file like so which works well with other projects I've done.

    <script type="text/javascript" src="mysite/javascript/lightbox/prototype.js"></script>
    <script type="text/javascript" src="mysite/javascript/lightbox/scriptaculous.js"></script>
    <script type="text/javascript" src="mysite/javascript/lightbox/lightbox.js"></script>
    <link href="themes/kmcolour/css/lightbox.css" rel="stylesheet" type="text/css" media="screen" / >

    and added the appropriate Requirements::block to the php file like so.

    public function init() {
    parent::init();
    Requirements::block('sapphire/thirdparty/jquery/jquery.js');
    Requirements::block('userforms/thirdparty/jquery-validate/jquery.validate.min.js');
    Validator::set_javascript_validation_handler('none');
    }

    But together they just don't get on. Especially the top group. When I remove the js sIFR works fine but of course lightbox don't work

    Has anyone come across this before?

    Should I be blocking anything else? Any help would be much appreciated.

    Forgot to mention how kick arse silverstripe is.
    It's made CMS and design translation so easy, coming from a design perspective.

    Cheers

  • biapar
    Avatar
    Forum Moderator
    435 Posts

    Re: sIFR and Lightbox2.0 conflict on ss2.4 Link to this post

    Use "noconflit" Jquery function.

  • SSadmin
    Avatar
    Community Member
    90 Posts

    Re: sIFR and Lightbox2.0 conflict on ss2.4 Link to this post

    using the this statement may help you solve the problem:

    ;(function($) {
    // this is a substitute for $(document).ready,
    // so you don't need to put that later on!
    $(function(){
    // your code here
    });
    })(jQuery);

  • Codenz
    Avatar
    Community Member
    6 Posts

    Re: sIFR and Lightbox2.0 conflict on ss2.4 Link to this post

    Thanks for the replies.
    Forgot to mention that I'm no JQuery ninja either.
    Should I apply this to Lightbox or sFIR js?
    Or is the an SS thing where I need to include it in the php or ss template?
    My understanding is that there is no real configuration function with Lightbox.
    You just add the file links in the head and insert the "rel="lightbox[example]" snip in the image link and away she goes.

    So I'm confused ast to where I should add the statement.

    More help would be much appreciated. Cheers.

    1162 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.