Announcement

Collapse
No announcement yet.

Inclusion of often-repeated HTML code - how?

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

    Inclusion of often-repeated HTML code - how?

    I hope this is a really simple one.

    On my site I have a need to include some identical blocks of HTML code in lots of places (navigation aid stuff). I currently use, at the top of each product section, a dummy "product" which cannot actually be purchased but which is simply a placeholder for descriptive text and pictures, which I create in an independent HTML editor and then include using !!<....stuff....>!! This all works very well. It is in these "products" that I wish to include this repeated HTML code. It's a bit clunky having to do it manually in each case, and a bit of a pain when it changes, so I wondered if there's a quick and easy way of "including" a file with the HTML code in, and make reference to that inclusion at each instance of usage, so any changes only have to occur once. I'm using Catalog v6.

    Is this something to do with templates?

    Sorry for being a bit thick.

    Nick
    Fighting with sellerdeck on http://www.nickdobsonwines.co.uk

    #2
    Save your HTML (eg MYHTML.HTML) as a file in the root of the site1 folder. Create a new CUSTOMVAR eg MYFILE. Make a new dummy product layout which includes CUSTOMVAR:MYFILE ... assign the variable the value of MYHTML.HTML (Design > Design Options) and tick the "file name" and that will insert the contents of the HTML file into your layout.

    To add to each section simply place the dummy product at the top of each section list. To edit all the dummy products simply edit MYHTML.HTML. Remember only include the basic HTML as if you are pasting between !!< >!! and not to have and <head> or <body> tags in there as these are already inserted from the Act_Primary.html

    HTH


    Bikster
    SellerDeck Designs and Responsive Themes

    Comment


      #3
      Thanks for the input - you're going too fast for me I'm afraid, a few things need explaining in a bit more detail:-

      Save your HTML (eg MYHTML.HTML) as a file in the root of the site1 folder.

      Done that.

      Create a new CUSTOMVAR eg MYFILE.

      How do I do that?

      Make a new dummy product layout which includes CUSTOMVAR:MYFILE ... assign the variable the value of MYHTML.HTML (Design > Design Options) and tick the "file name" and that will insert the contents of the HTML file into your layout.

      Do you mean create a dummy product, or a dummy product "type" - not sure how you do the latter. Is this a feature which came after v6, which I'm using?

      To add to each section simply place the dummy product at the top of each section list. To edit all the dummy products simply edit MYHTML.HTML. Remember only include the basic HTML as if you are pasting between !!< >!! and not to have and <head> or <body> tags in there as these are already inserted from the Act_Primary.html

      This looks logical once the above questions are resolved.

      But isn't there a simple way of INCLUDE-ing a file (containing basic HTML) into HTML between !!<.....>!! in any product? This might be a lot easier. Or is that what a CUSTOMVAR does?

      Thanks

      Nick
      Fighting with sellerdeck on http://www.nickdobsonwines.co.uk

      Comment


        #4
        CUSTOMVAR

        I don't have v6 on this machine but think you can find it under Advanced - Custom Properties... click "+" and enter a new text property

        Dummy Product

        Duplicate your existing "Act_ProductLine.html" template (or whichever product layout you are using) and add CUSTOMVAR:MYFILE just above where the product description is being inserted to the template. You can strip out the superfluous stuff you do not need if you want.

        Including:

        The customvar does just that ... just as Actinic sees the !!< >!! as a place holder to insert HTML the customvar with the "file name" option ticked sees this and inserts the contents of the file ... this can be plain text or HTML.

        Your current method of !!<>!! means if the text changes you need to change every instance of the dummy product. The customvar route is essentially the same but take the text (or HTML) from a single externally maintained file and inserts wherever it is found on the page.


        Bikster
        SellerDeck Designs and Responsive Themes

        Comment

        Working...
        X