+ Reply to Thread
Results 1 to 6 of 6

Thread: Homepage Script Persistent

  1. #1
    Join Date
    Nov 2009
    Posts
    34

    Default Homepage Script Persistent

    On our 9.12.2 site we have the TabAccordian template. On the test page everything worked perfectly but once we moved it to the homepage we started to have problems. The TabAccordian on the homepage still works great but it's looking like it broke some of our other templates on completely unrelated pages. After digging into the page source it appears that any scripts called (and added to <head>) are getting added to every page on the site. Is this a known occurrence? If so, can it be prevented or are there any workaround?
    Thanks!

  2. #2

    Default

    I have never seen something like this. (Although that doesn't mean there is no such thing, lol
    When you say "any scripts called", do you mean the script you refer to as being called is JavaScript/jQuery or DekiScript or the TabAccordian template?
    When you say "added to the head", do you mean added by writing it manually to the source head by you or by a script written yourself, or added by some other script like TabAccordion itself?
    Could you describe the method you use when you apply TabAccordion?
    Could you post the part you have in the editor's source view when you use TabAccordion?
    Could you specify which version of the TabAccordion do you use?
    What template/skin are you using?
    What browser are you using?
    Are you seeing any error messages from...
    the browser? (what type of errors?)
    the frontend? (what are they?)
    the api? (should be a long exception, include this)
    the webserver (apache, iis)?
    the deki-api.log?
    Last edited by edvin76; 09-09-2011 at 08:45 AM.

  3. #3
    Join Date
    Nov 2009
    Posts
    34

    Default

    Thanks for the response - after some more testing I think I found some more specific information about this issue.
    The scripts I am referring to are the javascript functions that we have in templates that are specified in the <head> section within the template so they get added to the <head> of the page. One of the pages called by our TabAccordion has a template on it with some javascript like this and not only is it in the head of the homepage (with the TabAccordion) but it is in the head of every single page now.
    We are using the latest TabAccordion from rberinger (2.1 9/13/2009) with some small modifications but nothing that would explain this behavior
    We are calling the TabAccordion just like a regular template call in the content of the homepage:
    Code:
    <pre class="script">
    TabAccordion{type:'tab',id: '#MyID1',
    content: [ {path:'/pathToPage', name:'tabName', allowedit:false},
    {path:'/pathToPage2', name:'tabName2', allowedit:false},
    {path:'/pathToPage3', name:'tabName3', allowedit:false},
    {path:'/pathToPage4', name:'tabName4', allowedit:false},
    {path:'/pathToPage5', name:'tabName5', allowedit:false}] ,
    options: {collapsible:false, event: 'click'}}</pre>
    But as for the new information that should shed some light on this - it appears that it isn't breaking all of our templates. The two that we have noticed it breaking is the DataTables template (http://developer.mindtouch.com/Templateatatable) and the CollapseItem (v1.01 from neilw) template. Both of these use the Deki.$(document).ready call - could this be an issue?

    The only place I am getting errors is on the frontend through the firebug console - the one that stands out as being related to this is:
    Code:
    $table.find(".deki-editable").editable is not a function
       onSuccess: function($el, old, response)                          js.php....T,ADMIN(line 4076)
    Of course that isn't expanding the error but doing so would show the entire javascript code at line 4076.

    I even added a check on the TabAccordion template as a long shot so that if the page id = homepage id then use the template else not. But this didn't change anything.

    Any help/ideas is greatly appreciated.

  4. #4

    Default

    Ok there is a jquery-1.3.2.js attached to the TabAccordion homepage, whilst there is also an instruction there to link all those attached files to your template.
    It is important to know that MindTouch has its own jQuery hardcoded in.
    Your error message normally appears to me when there are conflicting instances of jQuery libraries used on the same page.
    First please remove the jquery-1.3.2.js (the one you got from TabAccordion page) from the location you saved it on your server,
    then remove the line along this line from all your scripts/templates which you have these particular problems with:
    <script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script>
    and see if there are different or fewer error messages after that.
    Last edited by edvin76; 09-11-2011 at 01:06 PM.

  5. #5
    Join Date
    Nov 2009
    Posts
    34

    Default

    Hey edvin76 -
    Perfect! Removing the reference to jquery-1.3.2.js in the TabAccordion template solved all our problems. I wasn't aware that Mindtouch had it built in but it makes sense now.
    Thanks a lot for your help.

  6. #6

    Default

    Your welcome, I'm happy if I can help. I just wish my questions were ansewered by someone, but as you see, I have at least 6-7 questions here on the forums, and noone has even looked at them, let alone answering. I think this forum is dead or everyone's on holiday....

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts