Jump to:

1835 Posts in 1139 Topics by 554 members

Blog Module

SilverStripe Forums » Blog Module » Blog Module Jquery conflict

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 1188 Views
  • webtonic
    Avatar
    Community Member
    26 Posts

    Blog Module Jquery conflict Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Blog Module Jquery conflict Link to this post

    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)

  • biapar
    Avatar
    Forum Moderator
    435 Posts

    Re: Blog Module Jquery conflict Link to this post

    you use Jquery noconflict declaration.

  • webtonic
    Avatar
    Community Member
    26 Posts

    Re: Blog Module Jquery conflict Link to this post

    thanks Will - that was the answer

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