Announcement

Collapse
No announcement yet.

Javascript Question

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

    Javascript Question

    Hi All,

    We are working on an Actinic 8 site and have the following question.

    The site has 10 or so main categories. We would like to have a prompt that pops up for 2 or 3 of the categories. This prompt will have 2 choices, either yes - view the page, or No be directed away from the page.

    As mentioned, this is only for some sections of the site and the products contained therein. So is there a way of inserting the following code - or similar - into the head area of selected sections of the Actinic??

    <SCRIPT LANGUAGE="JavaScript"><!--

    function checkCount() {

    if ( !document.cookie.length )
    {
    input_box=confirm("Click OK or Cancel to Continue");

    if (input_box==true)

    {
    // Output when OK is clicked
    document.cookie = 'popup=no';
    }

    else
    {
    // Output when Cancel is clicked
    window.location = "http://www.google.co.uk";
    }
    }


    }

    -->
    </script>

    This function is called when the page loads up.

    Cheers for any help received

    Grant

    #2
    You could use conditions to show/hide this block of code on certain sections.

    Create a new variable called 'RedirectMessage' or something with a prompt of 'Allow Customers To Redirect?'. Set the 'Place of Setting' to 'Section' and give it a Type of 'true/false' and set the 'Top Level Value' to 'False' and the 'Initial Value' to 'Use Parent'.

    Now you can highlight your code in the headers to the page (the code needs to be in the overall page layout) and then click the 'Insert Block' button and just enter 'RedirectMessage' into the condition editor.

    That way, the script code will only appear if 'Allow Customers To Redirect?' has been set to 'True' for a section in the store.

    Comment


      #3
      Thank you Chris - we will give this a go

      Comment

      Working...
      X