Announcement

Collapse
No announcement yet.

Variable dependant section box

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

    Variable dependant section box

    I've added a couple of variables in the library. One is called 'New' which has a true/false value. What I want to do to just show the normal Section Link within a Box layout when the value is false, but show a slightly different layout when the value is true. (Basically, I want to stick a 'New' icon over the top of the box) Has anyone done or seen this done anywhere?
    Cheers
    Stuart

    #2
    You need to use a Blockif statement and test for TRUE or FALSE and then place your differing code inside the Blocks. Check the help on the use of Blockif.

    Comment


      #3
      Thanks Duncan, I got this working a treat with this little bit of code:

      Code:
      <actinic:block if="%3cactinic%3avariable%20name%3d%22Sale%22%20%2f%3e" ><div class="icon_sale"><img border="0" src="images/icon-sale.png"></div</actinic:block>
      This code adds a 'new' icon over a section image, which looks really good. I've done the same for 'sale' when an item is on sale. Question is, can I use a similar technique to say:

      Find all products where sale = true
      Display all products in sale section

      (This to saving having to duplicate them all again. Or is the only way of doing this simply to add product duplicates?)
      Cheers
      Stuart

      Comment


        #4
        Yes, create a section for the sale items. In that section place any dummy product. Create a new Product List Layout. In that place a Section List, Product List and Blockif test. Inside the Blockif test place a product layout.
        Code:
        <actinic:block type="EntireSectionList" >
        	<actinic:block type="ProductList" >
        		<actinic:block if="My variavble test for TRUE" >
        				My Product Layout
        		</actinic:block> 
        	</actinic:block> 
        </actinic:block>
        That will then look through all the catalog and list products matching your Blockif test.

        The code I have given will need modifying with your own test and product layout of course.

        This is also documented elsewhere in the forum in more detail.

        Comment


          #5
          Great answer Duncan! I'll have a go at this later today and let you know how I get on. I'm glad this is possible because it will be a big time saver rather than keep duplicating sections and products into the sale section.
          Cheers
          Stuart

          Comment

          Working...
          X