Page 1 of 1

Trying to insert javascript into column_left.tpl file

Posted: Sat Mar 05, 2011 1:17 am
by DD0UG
Hey all,

I'm having issues adding a javascript menu into the column_left.tpl file.

I keep entering the code and when I upload it is just text with no javascript.

Help please.

Re: Trying to insert javascript into column_left.tpl file

Posted: Sat Mar 05, 2011 1:28 am
by SXGuy
Show us your code.

Re: Trying to insert javascript into column_left.tpl file

Posted: Sat Mar 05, 2011 1:52 am
by DD0UG

Code: Select all

<script src="../../../../../../SpryAssets/SpryAccordion.js" type="text/javascript"></script>
<link href="../../../../../../SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
<div id="column_left">
  <div id="Accordion1" class="Accordion" tabindex="0">
    <div class="AccordionPanel">
      <div class="AccordionPanelTab">Label 1</div>
      <div class="AccordionPanelContent">Content 1</div>
    </div>
    <div class="AccordionPanel">
      <div class="AccordionPanelTab">Label 2</div>
      <div class="AccordionPanelContent">Content 2</div>
    </div>
  </div>
</div>
  
<script type="text/javascript">
var Accordion1 = new Spry.Widget.Accordion("Accordion1");
</script>

Re: Trying to insert javascript into column_left.tpl file

Posted: Sat Mar 05, 2011 4:37 am
by SXGuy
place this in your header file

<script src="../../../../../../SpryAssets/SpryAccordion.js" type="text/javascript"></script>
<link href="../../../../../../SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />

remove ../ and use absolute path from root. infact, look how the others are placed and copy the same structure.

Leave the rest as it is for column_left.tpl

have no idea why it doesnt upload as code, and just text, perhaps your js file is some how breaking the code.

Re: Trying to insert javascript into column_left.tpl file

Posted: Fri Mar 11, 2011 8:58 am
by DD0UG
Thanks so much !
That worked great I changed the src to the site root style that took care of it.