Announcement

Collapse
No announcement yet.

Block Ifs - one works great, the other doesn't!

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

    Block Ifs - one works great, the other doesn't!

    Hi,

    I have used block ifs to create different headers for different section of the site which works fine (it uses variables of "category") - see code below;

    <!-- TopSection -->
    <div class="top-section">
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ContentCategory%22%20%2f%3e%20%20%3d%3d%20%20%22Pearl%2dBracelet%22" ><img src="images/pearls-bracelets.jpg" width="950" height="200" /></actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ContentCategory%22%20%2f%3e%20%20%3d%3d%20%20%22Pearl%2dBrooch%22" ><img src="images/pearls-brooches.jpg" width="950" height="200" /></actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ContentCategory%22%20%2f%3e%20%20%3d%3d%20%20%22Pearl%2dEaring%22" ><img src="images/pearls-earings.jpg" width="950" height="200" /></actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ContentCategory%22%20%2f%3e%20%20%3d%3d%20%20%22Pearl%2dNecklace%22" ><img src="images/pearls-necklaces.jpg" width="950" height="200" /></actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ContentCategory%22%20%2f%3e%20%20%3d%3d%20%20%22Pearl%2dRings%22" ><img src="images/pearls-rings.jpg" width="950" height="200" /></actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ContentCategory%22%20%2f%3e%20%20%3d%3d%20%20%22Statement%2dDifferent%22" ><img src="images/statement-different.jpg" width="950" height="200" /></actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ContentCategory%22%20%2f%3e%20%20%3d%3d%20%20%22Statement%2dUnique%22" ><img src="images/statement-unique.jpg" width="950" height="200" /></actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ContentCategory%22%20%2f%3e%20%20%3d%3d%20%20%22Statement%2dTimeless%22" ><img src="images/statement-timeless.jpg" width="950" height="200" /></actinic:block>
    </div>
    <!-- endTopSection -->

    I am also trying to use blockifs in exactly the same way to have different submenus for each section which hasn't been as successful, would anyone be able to see why this is as I'm running out of hair. See code below;

    <actinic:block if="%3cactinic%3avariable%20name%3d%22ContentCategory%22%20%2f%3e%20%3d%3d%20%22Pearl%2dBracelet%22%20%20OR%20%22Pearl%2dBrooch%22%20%20OR%20%22Pearl%2dEaring%22%20%20OR%20%22Pearl%2dNecklace%22%20%20OR%20%22Pearl%2dRing%22" >
    <div class="main-product-left">
    <ul id="side-menu">
    <li><a href="http://www.zaharalondon.com/acatalog/test/acatalog/pearl-collection-bracelets.html">Bracelets</a></li>
    <li><a href="http://www.zaharalondon.com/acatalog/test/acatalog/pearl-collection-brooches.html">Brooches</a></li>
    <li><a href="http://www.zaharalondon.com/acatalog/test/acatalog/pearl-collection-earings.html">Earings</a></li>
    <li><a href="http://www.zaharalondon.com/acatalog/test/acatalog/pearl-collection-necklaces.html">Necklaces</a></li>
    <li><a href="http://www.zaharalondon.com/acatalog/test/acatalog/pearl-collection-rings.html">Rings</a></li>
    </ul>
    </div>
    </actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ContentCategory%22%20%2f%3e%20%3d%3d%20%22Statement%2dDifferent%22%20%20OR%20%22Statement%2dTimeless%22%20%20OR%20%22Statement%2dUnique%22" >
    <div class="main-product-left">
    <ul id="side-menu">
    <li><a href="http://www.zaharalondon.com/acatalog/test/acatalog/pearl-collection-bracelets.html">Bracelets</a></li>
    <li><a href="http://www.zaharalondon.com/acatalog/test/acatalog/pearl-collection-brooches.html">Brooches</a></li>
    <li><a href="http://www.zaharalondon.com/acatalog/test/acatalog/pearl-collection-earings.html">Earings</a></li>
    </ul>
    </div>
    </actinic:block>

    Thank you,
    Ollie

    #2
    On your Blockif where you are using 'OR' you need to add the variable name to each OR option, not just the first one. So:

    <actinic:variable name="ContentCategory" /> == "Pearl-Bracelet" OR
    <actinic:variable name="ContentCategory" /> == "Pearl-Brooch"

    etc.......

    Comment


      #3
      Lee,

      Thank you so much - that did the trick. Really appreciate you taking the time.

      Cheers,
      Ollie

      Comment

      Working...
      X