Loading...
 
Skip to main content

Themes


How do I add Javascript to my site layout

I am setting up ))TikiWiki(( having just installed. I want my wiki pages to look as close to the rest of the site as possible. All other pages have a graphic at the top plus a Javascript-based horizontal menu bar just below the graphic.

Under Site Identity, I'm using the Custom Code feature to add the graphic, positioned correctly. I was hoping to also add the JS code to display the menu (3 script tags). However, as the default contents of the Custom Code field said, my javascript tags are being deleted as soon as I save the changes.

What do I need to do to add some script tags to every page as I am wanting to?
Thanks.

David.

Surround the javascript with the {literal} tag.

HTH,

-RickQuestion

> I am setting up ))TikiWiki(( having just installed. I want my wiki pages to look as close to the rest of the site as possible. All other pages have a graphic at the top plus a Javascript-based horizontal menu bar just below the graphic.
>
> Under Site Identity, I'm using the Custom Code feature to add the graphic, positioned correctly. I was hoping to also add the JS code to display the menu (3 script tags). However, as the default contents of the Custom Code field said, my javascript tags are being deleted as soon as I save the changes.
>
> What do I need to do to add some script tags to every page as I am wanting to?
> Thanks.
>
> David.


Just to add a bit more detail to what Rick said, the Javascript should go in a template (.tpl) file. Code meant for the head section of the page or the beginning of the body section should go in header.tpl.

-- Gary


Thanks very much. Modifying the header.tpl file did the trick.
David