Jump to:

22977 Posts in 11742 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Page Comments Conflict with other Scripts

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: 760 Views
  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Page Comments Conflict with other Scripts Link to this post

    I have run into this before. I have made many sites where I use javascript in the head to run a rotating header image. When I turn on "Allow comments on this page?" or on a form page the header defaults to the background I have setup, and kills the script.

    Now I am trying to get a slide out script running for a side menu, works great - until I add the page comments to the page.

    When I look at the source code, I am running LiveZilla (chat script) on my pages. Been working fine even with comments turned on. However, when I look at the source code I see that when comments are turned on, it adds a number of scripts right in the middle of the Livezilla script. It does not effect the LiveZilla script, but it is killing my menu slide out script.

    The menu script uses this google script...

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

    Any ideas on this, or does anyone know where I might be able to control the scripts for the comments?
    Thank you,
    Steve

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Page Comments Conflict with other Scripts Link to this post

    Add this to your _config.php:

    PageCommentInterface ::set_use_ajax_commenting(false);

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Page Comments Conflict with other Scripts Link to this post

    Hi Hamish,

    EDIT:

    Sorry my last comment was related to the shopping cart I am working on. I will try this and see what I get for forms and comments.

    Thank you,
    Steve

  • Solo
    Avatar
    Community Member
    32 Posts

    Re: Page Comments Conflict with other Scripts Link to this post

    Your problem is with conflict in different libraries or you have two times call of jquery. Try to Google that: "jQuery no conflict", or if you have two times call of jquery remove one

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Page Comments Conflict with other Scripts Link to this post

    That is a very big possibility. I am using several in the template, but should be called only with the correct IF. I will do some testing and checking the source.

    Thank you,
    Steve

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Page Comments Conflict with other Scripts Link to this post

    I have gone a different rout with a different script, but I will keep this in mind.

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