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.

Blog Module /

Discuss the Blog Module.

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

Blog Module Jquery conflict


Reply


4 Posts   1305 Views

Avatar
webtonic

Community Member, 26 Posts

19 June 2010 at 11:51am

Edited: 19/06/2010 11:53am

Hi

I have just installed the Blog module on my staging site at

http://www.staging.webtonic.co.nz/blog/sample-blog-entry/

and the javascript call is killing my scripts running on Jquery. I have managed to get the UserDefined Forms to work (just turned off the Jquery call in udf as it was being called twice)
It appears that the blog comments still runs on prototype.js any hints on how I can get this to enable my jquery to work and enable the comments on the blog?

I am running 2.4

thanks
Craig

Avatar
Willr

Forum Moderator, 5513 Posts

20 June 2010 at 12:50am

Edited: 20/06/2010 12:51am

All the modules, core should reference the jquery in the thirdparty dir in 2.4 - sapphire/thirdparty/jquery.js. To avoid issues of multiple labels ideally you should use this version of jquery with your theme (rather than with one added to your theme) as most modules which use JS will include the one from the jsparty you'll have a much easier time!

Also to work with prototype your custom jquery code should be written in a closure like this example - http://doc.silverstripe.org/javascript (even if yours is not a plugin you should use a closure)

Avatar
biapar

Forum Moderator, 435 Posts

20 June 2010 at 8:07am

you use Jquery noconflict declaration.

Avatar
webtonic

Community Member, 26 Posts

20 June 2010 at 6:50pm

thanks Will - that was the answer