Announcement

Collapse
No announcement yet.

How to parse in outer template if product is visible on the page

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

    How to parse in outer template if product is visible on the page

    Hi All,
    Asked about this sort of thing before:
    http://community.actinic.com/showpos...26&postcount=7

    I need to parse content to my main outer template if a product appears on the page (not a specific product, just any product/s).

    I think norman came up with a php idea in the post I have linked to but it doesn't work for me and maybe it gets broken as I have to parse javascript to the page.

    Any other thoughts, can it be done just using blockif without php?

    I think it would be very useful if this could be done,
    Regards
    Bangers
    Boxhedge New Media Design
    Design and development solutions for SME's.
    Tel: 0118 966 2786
    Examples of work can be found at http://www.boxhedge.com

    #2
    OK I thnk I got it:

    <actinic:variable name="MainSection::SectionHasVisibleProduct" /> == false

    or

    <actinic:variable name="MainSection::SectionHasVisibleProduct" />

    depending on what you need, seems to work so far. Anything smacking others in the face that it won't work?

    Does anyone concur that this does indeed work?

    Regards
    Bangers
    Boxhedge New Media Design
    Design and development solutions for SME's.
    Tel: 0118 966 2786
    Examples of work can be found at http://www.boxhedge.com

    Comment


      #3
      Just test it on Brochure and Cart type pages to be sure it's OK there.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        That error may be coming from Cart, Search, etc. pages where Section variables are meaningless.

        Perhaps putting a BlockIf of PageType == "Section" around the code in question will fix it.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          But Products only exist in Sections (and possibly the store top page).
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            The code I was playing with was to show something on non product pages. Using 'PageType == Section' would not work as it blocks code from brochure and cart etc. I was trying to think of a way around multiple blockifs. By the way bangers code does work if but for the "you're not really meant to use that variable in this layout" warnings.
            Peblaco

            Comment


              #7
              Louise,

              Ahah. You're doing something different.

              Only variable mentioned so far was MainSection::SectionHasVisibleProduct so that's what I was talking about.

              Would need to know what you're doing to be able to suggest anything.

              If it's code meant to show on all non-Section pages and not show for Section ones, then PageType != "Section" would do.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                It can be simplified slightly:
                Code:
                BLOCKIF PAGETYPE == SECTION
                	BLOCKIF SECTIONHASVISIBLEPRODUCT
                		Code for sections with products (no banner or alternative code)
                	/BLOCKIF
                	BLOCKIF SECTIONHASVISIBLEPRODUCT == FALSE
                		Code for sections without products (banner)
                	/BLOCKIF
                /BLOCKIF
                
                BLOCKIF PAGETYPE != SECTION
                	Code for non sections (banner for brochure, cart etc)
                /BLOCKIF
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  And a note for V11 tweakers. The new Product Page layouts return a PageType of "Product Page". So you may need:

                  BLOCKIF (PAGETYPE == SECTION) OR (PAGETYPE == PRODUCT PAGE)

                  and the converse:

                  BLOCKIF (PAGETYPE != SECTION) AND (PAGETYPE != PRODUCT PAGE)
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment

                  Working...
                  X