Announcement

Collapse
No announcement yet.

Opposite test for ProductList

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

    Opposite test for ProductList

    I have a layout which uses very specific CSS depending if it's a category (section) list or if it's product list (as I'm using single product pages).

    I know I can use the following code to only insert something if it's a Product List, but I want to test and display something if it isn't a Product List. Can't seem to get that working.

    Any ideas?

    Code:
    <actinic:block type="ProductList" >
    Web . Design . Multimedia . Branding

    #2
    Late so reasoning may be muddied but I think as far as Actinic goes a "section" is both a section listing (of sub-sections) and a page of products (within a section).

    The anomaly here is "products" ... so try a block if with a condition to test if your ProductList block contains no products (ListCount < 1 or possibly ListCount != )


    Bikster
    SellerDeck Designs and Responsive Themes

    Comment


      #3
      Thanks for the reply Jont.

      Not sure if I'm doing something wrong, but that now works within the Product list (cool!), but when I view a section list it's not showing the content (boo). Here's the code I'm using within 'CSS Section Link Layout':

      Code:
      <div class="grid_4">
      	<a href="<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>" class="<actinic:block type="ProductList" >prod</actinic:block>cat">
      		<actinic:block if="%3cactinic%3avariable%20name%3d%22ListCount%22%20%2f%3e%20%3c%201" >
      		<!-- Only show this on a category list -->
      		<p><actinic:variable name='SectionName'/></p>
      		<img alt="<actinic:variable name="SectionName" encoding="strip"/>" src="<actinic:variable Name="SectionImageFileName"/>" />
      		<!-- //Only show this on a category list -->
      		</actinic:block>
      		<actinic:block type="ProductList" >
      		<!-- Only show this on a product list -->
      		<div>
      			<img alt="<actinic:variable name="SectionName" encoding="strip"/>" src="<actinic:variable Name="SectionImageFileName"/>" />
      		</div>
      		<p><actinic:variable name='SectionName'/></p>
      		<em>£5.95</em> <span>| Girls</span>
      		<!-- //Only show this on a product list -->
      		</actinic:block>
      	</a>
      </div>
      Web . Design . Multimedia . Branding

      Comment


        #4
        Don't suppose anyone else has got any other ideas on this one? Still can't get it to work
        Web . Design . Multimedia . Branding

        Comment


          #5
          Lateral thinking solution:

          Go to Design / Library / Layouts / Product Lists.

          Right-click "Bare Product List" and choose Copy.

          Rename that copy to be "Empty Product List Code".

          Edit that new layout and replace all contents with:
          Code:
          <actinic:block if="%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%201" >
          	SOME PRODUCTS ON PAGE
          </actinic:block>
          Click the "Click here to edit list layout settings" and in Empty List put:
          Code:
          NO PRODUCTS ON PAGE
          Finally test this by putting into your overall layout:
          Code:
          <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Section%22">
          	<actinic:variable name="ProductList" value="Empty Product List Code" />
          </actinic:block>
          Tune by replacing the stuff in capitals with your own HTML.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Norman, you are 'the man'! That works like a dream.

            Thank you very very much. Can I buy you a virtual beer?
            Web . Design . Multimedia . Branding

            Comment


              #7
              I'd never used "Empty List" before but having poked around all the nooks and crannies of Actinic at least I knew it was there.

              I'm in Turkey at the moment. It'll have to be a virtual raki.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                For anyone who is trying to use this method, which does generally work great, I have run into an issue:

                When displaying the section list layout (i.e. not on a product list) with our alternative layout, all is fine until we add a fragment to that section. The layout then things it's not empty so displays the product list format.

                I haven't found a solution to work around this issue, so if anyone else has an alternative solution to display a different list layout for categories and products then I'd really love to hear them.
                Web . Design . Multimedia . Branding

                Comment


                  #9
                  Fragments are treated the same as products, the producttype variable distinguishes between products, duplicates and fragments with (0,1 or 2), can't recall which ones denotes a fragment but you should be able to filter using that variable.

                  Comment


                    #10
                    Lee you're a frickin star!!!!

                    I have not used the variable ProductType before and you are correct, I can use the following block if around my product layout to test if it's a product (0) and not a fragment (2).

                    Code:
                    <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductType%22%20%2f%3e%20%20%3d%3d%200" >
                    	MY PRODUCT LAYOUT CODE IN HERE
                    </actinic:block>
                    So basically if the section has a fragment on it, this code will ignore that and produce an empty list, so my other "empty list code" still gets used.
                    Web . Design . Multimedia . Branding

                    Comment


                      #11
                      Cool, you may want to also cover for when a duplicate product is on page, from your findings I presume that is producttype 1, i'm guessing that you should also be catering for that in the same way as a master product just in case.

                      Comment


                        #12
                        Yes, was just going to add the duplicate code in as well.

                        Thanks again.
                        Web . Design . Multimedia . Branding

                        Comment

                        Working...
                        X