Announcement

Collapse
No announcement yet.

Apply Javascript just to Home page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Apply Javascript just to Home page

    Hi

    I'd like to add a Javascript banner image rotator to the Homepage of my website. How do I add Javascript code into the (header and body of the) Homepage without it also appearing on other content pages in my site?

    Thanks

    Jon

    #2
    A block if testing the IsStoreFrontPage variable should be what you need.

    See: http://community.sellerdeck.com/showthread.php?t=52044

    Mike
    -----------------------------------------

    First Tackle - Fly Fishing and Game Angling

    -----------------------------------------

    Comment


      #3
      Thanks Mike - that's done the trick. Cheers

      Comment


        #4
        Unfortunately using the block if statement doesn't seem to have worked. I used the following code:

        <actinic:block if="%3cactinic%3avariable%20name%3d%22IsStoreFrontPage%22%20%2f%3e%20%20%3d%3d%20false" >
        <link href="themes/1/js-image-slider.css" rel="stylesheet" type="text/css" />
        <script src="themes/1/js-image-slider.js" type="text/javascript"></script>
        <link href="generic.css" rel="stylesheet" type="text/css" />
        </actinic:block>

        The scripts contained within the block if statement are still within the source code for every page, regardless of whether or not it is the homepage.

        Can anyone help with where I've gone wrong with this?

        Thanks

        Comment

        Working...
        X