how to add javascript in head in cmsms

762 views Asked by At

I want to add a small redirect javascript on the home page of my website. I am using CMS made simple platform. Ho do I edit HEAD tag in CMSMS. I need to put this javascript in HEAD tag. How do I do that?

Thanks in advance.

2

There are 2 answers

0
maidbloke On

In admin area: Layout -> Templates. Edit your template. Find the part of the HEAD you want to add javascript to. Add javascript between these tags:

{literal} ...javascript goes here... {/literal}

Save template. (The literal tags are needed so CMS Made Simple knows to interpret any { } as javascript and not Smarty).

1
Henri Hietala On

If you don't have permissions to edit page templates, here is another solution to this:

Go to Pages -> Select your homepage for editing -> Options-tab -> Page Specific Metadata and add the javascript block there as maidbloke presented:

{literal} <script type="text/javascript"> ... </script> {/literal}

This works if your home page template has {metadata}-tag in it (which is very likely).