Announcement

Collapse
No announcement yet.

Hiding a graphic link to a section with no products

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

    Hiding a graphic link to a section with no products

    I have two product sections defined, called Special Offers and Clearance Items, which will only occasionally have products available. When there are no products available for either of these product categories, I can click ‘Hide on Web Site’ in the Section Details for the relevant section, and the menu links for that category are no longer visible, and that is a simple solution.

    However, in addition to menu links, I also have two dedicated graphics in a side column (on the home page and on all product pages), and code in the Outer layout makes these graphics hyperlinks to the relevant product section page, e.g. <a href="special-offers.html"><img src="special-offers.gif" /></a>.

    I would also like to hide these graphics, whenever the relevant product sections have no products defined. I imagine this would require the use of a Block If code structure, and either a standard built-in variable (if available) or a custom variable.

    Please suggest some sample code which I could try.

    James

    #2
    If you set up a custom variable with a blockif see here it can be used to hide sections see here. Alternatively you could do it the other way around, wrap the blockif around the menu to switch the menu and image and more. So you could do 3 or 4 actions from one menu setting.
    Peblaco

    Comment


      #3
      Thanks peblaco,

      While awaiting suggestions on how to automate the process, that's what I've done -- created separate custom variables for Special Offers and Clearance Items sections, with Site settings of True/False.

      This means the site operator will have two steps to follow:
      1. Set or clear 'Hide on Web Site' for the relevant section in Section Details
      2. Set the relevant custom setting to show/hide the outer layout graphic

      This works, but to avoid the operator forgetting one of the above steps, I was hoping to write a BlockIf condition (in the outer layout) to automate step #2 (hiding the graphics), but I don't know of any standard variable (with scope within an outer layout) which I can use in a BlockIf to determine if a speficic section has zero products defined (assuming the site operator has removed the Special Offers or Clearance Items products).

      I realise this is not a V10 issue, so should have put this thread in the 'Layout Adjustments & Changes' forum section, and maybe it's too late now to ask a Moderator to move it there.

      James

      Comment


        #4
        Alternatively you could do it the other way around... So you could do 3 or 4 actions from one menu setting.

        Yes, that's a good suggestion, which I will consider.

        Rolling multiple operator actions into one will eliminate possible operator error, and reduce operator training.

        Thanks also for the KB article link.

        James

        Comment

        Working...
        X