Announcement

Collapse
No announcement yet.

Customvar in Main Menu

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

    Customvar in Main Menu

    I have a Customvar in the Act_Primary which inserts a image as specified in the SECTION | PROPERTIES tab and coded as follows:

    <img src="CUSTOMVAR:SECTION_IMAGE" alt="NETQUOTEVAR:PAGEHEADER">

    This works fine for all sections and subsections other than the MAIN MENU and SEARCH which simply shows the "image missing with a red cross" error as no file is specified - there does not appear to be anywhere to specify an image.

    Other than changing the pages manually is there a way around this?


    Bikster
    SellerDeck Designs and Responsive Themes

    #2
    Should add this only occurs in IE and not Firefox which simply adds in the Alt text in lieu of the image


    Bikster
    SellerDeck Designs and Responsive Themes

    Comment


      #3
      These pages come from cgi-bin or the site root. Your image is in /acatalog.

      A <BASE HREF=...> can fix this or use

      <img src="/acatalog/CUSTOMVAR:SECTION_IMAGE" alt="NETQUOTEVAR:PAGEHEADER">

      or

      <img src="http://www.mysite.com/acatalog/CUSTOMVAR:SECTION_IMAGE" alt="NETQUOTEVAR:PAGEHEADER">
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Hi Norman,

        its not the source thats the problem - they are displaying fine in sections and subsections as I can specify the CUSTOMVAR in the section properties tab to include the file.

        As the CUSTOMVAR is embedded into the Act_Primary I can see no easy way to specify which image to use for the MAIN MENU and then on the Search Page - neither of these has a standard properties tab to specify the CUSTOMVAR file.

        What about creating a new CUSTOMVAR:IMG that would work such as

        <CUSTOMVAR:IMG src="CUSTOMVAR:SECTION_IMAGE" alt="NETQUOTEVAR:PAGEHEADER">

        then setting the CUSTOMVAR:IMG to "img" in store defaults - would that simply add the imgage where specified and the browser would then ignore the code and not try and insert an image that does not exist? I can live with having no image on those 2 pages.


        Bikster
        SellerDeck Designs and Responsive Themes

        Comment


          #5
          Got you now. The CUSTOMVAR is null on certain pages. JavaScript can fix this:
          Code:
          <script language=JavaScript>
          <!--
          if ( 'CUSTOMVAR:SECTIONIMAGE' ) document.write('<img src="CUSTOMVAR:SECTIONIMAGE" alt="NETQUOTEVAR:PAGEHEADER">');
          //-->
          </script>
          Just make sure the single quote character is never used in your page header as it will break this code.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Many, many thanks Norman - lateral thinking was never a strong point - must try and remember to do things outside of Actinic.


            Bikster
            SellerDeck Designs and Responsive Themes

            Comment


              #7
              That little bit of conditional code is quite useful wherever you want to use a CUSTOM property to define an additional image, and that property might be empty in certain cases.

              I used it only yesterday in a very concise product template to show a tiny icon of each image with a full-scale popup if you clicked the icon.
              Code:
              <!-- NETQUOTEVAR:PRODUCTIMAGE -->
              <script language=JavaScript>
              <!--
              var img = 'NETQUOTEVAR:IMAGEFILE';
              if ( img ) document.write('<img style="cursor: pointer" src=' + img + ' width=50 onclick="ShowPopUp(\'' + img + '\',400,400)">');
              //-->
              </script>
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment

              Working...
              X