Show JavaScript code only on the homepage head

Hi,
I need to enter a javascript code only in the head of the homepage.

I tried to use the following condition:
{if $baseurl}
test
{/ If}
but the word “test” is shown in the header of each page

How can I do it?

Thanks

Hi @aliggie,

Here is your condition

{if $this_page == 'Index'}
test
{/if}

Thanks

1 Like

Allow me to correct your suggestion
{if $this_page == 'index'}
test
{/if}

I thank you for your precious reply. A list of variables and a guide on how to insert new ones and verify those currently present would be useful.

ClipBucket is the best and I carry it in my heart