Announcement

Collapse
No announcement yet.

Cascading code changes in multiple versions of Act_Primary

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

    Cascading code changes in multiple versions of Act_Primary

    Hi

    I currently have a number of versions of Act_Primary. All of which contain a left hand nav (written in Javascipt) which are identical. At the moment the 5 x Act_Primary's have individual left hand navs - therefore everytime I make a change to the left hand nav I have to duplicate my work 5 x over.

    Is there any way of putting the left hand nave code in a seperate file and then having each Act_Primary call this code?

    Paul
    KJ Beckett
    Men's Clothing & Accessories
    Cufflinks, Underwear, Ties, Grooming Products
    Bath, England
    Fast delivery to UK, USA and worldwide.
    Men's Fashion Blog

    #2
    Hi Paul,
    You could simply place the relevant menu code into a txt file and include this into the 5 x Primary Templates as a customvar with "Use as File Name" and "Use File Contents" ticked and the txt file name as the customvar value.
    You will then only have to amend the HTML within the single text file rather than on 5 Primary Templates.

    [example]

    in the txt file e.g. menuhtml.txt
    ~~~~~~~~~~~~~~~~~~~~~
    <!--
    you would have you menu html in this file
    //-->
    <ul>
    <li><a href="page1.html">Menu item 1</a></li>
    <li><a href="page2.html">Menu item 2</a></li>
    </ul>
    ~~~~~~~~~~~~~~~~~~~~~

    Create a CUSTOMVAR called something like MENUHTML in "Advanced | Custom Properties", then in "Design | Options" in "Site Defaults" add a new properties row choosing MENUHTML as the custom property, entering menuhtml.txt as th e value and checking "Use as CUSTOMVAR", "File Name" AND "Use File Content".

    You then need to insert
    CUSTOMVAR:MENUHTML
    into your 5 x primary templates wherever you require this menu html to appear.
    N.B. Ensure the menuhtml.txt file is saved into your site1 folder.
    [end of example]
    Fergus Weir - teclan ltd
    Ecommerce Digital Marketing

    SellerDeck Responsive Web Design

    SellerDeck Hosting
    SellerDeck Digital Marketing

    Comment


      #3
      If your code uses Actinic NETQUOTEVAR Tags then these won't be expanded if you use a Custom Property as above. Weirdly CUSTOMVARS are expanded.

      Using the following works for both CUSTOMVARS and NETQUOTEVARS

      NETQUOTEVAR:INCLUDE filename.txt

      And is a little easier to maintain as it's all there in one place rather than having to look in a Custom Property to see what the filename is.

      Here's the note from the Help re Includes

      ****************************

      Include NETQUOTEVARs - All templates can include the variable NETQUOTEVAR:INCLUDE and then a filename e.g.:

      NETQUOTEVAR:INCLUDE Act_Product.html

      This causes the file named after the INCLUDE (up to the next NETQUOTEVAR or the end of the file) to be inserted into the template.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Normans method is actually a cleaner way of achieving the desired effect.
        Fergus Weir - teclan ltd
        Ecommerce Digital Marketing

        SellerDeck Responsive Web Design

        SellerDeck Hosting
        SellerDeck Digital Marketing

        Comment

        Working...
        X