Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

sIFR and Lightbox2.0 conflict on ss2.4


Reply


4 Posts   1195 Views

Avatar
Codenz

Community Member, 6 Posts

20 August 2010 at 6:18pm

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

Avatar
biapar

Forum Moderator, 435 Posts

22 August 2010 at 7:41am

Use "noconflit" Jquery function.

Avatar
SSadmin

Community Member, 90 Posts

23 August 2010 at 10:35am

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);

Avatar
Codenz

Community Member, 6 Posts

23 August 2010 at 3:40pm

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.