Can this be used to show a total of subsections within a section? (eg spp pages)
PS Excuse me if its obvious but I'm a fool.
PS Excuse me if its obvious but I'm a fool.
- Main section 1 (6 products) - Sub 1 (3 Products) - Prod - Prod - Prod - Sub 2 (1 Products) - Prod - Sub 3 (2 Products) - SubSub 3 (1 Product) - Prod - SubSub 3 (1 Product) - Prod
<actinic:block php="true"> $count = 0; <actinic:block type="ProductList" if="%3cactinic%3avariable%20name%3d%22ProductType%22%20%2f%3e%20%3d%3d%200" >$count++;</actinic:block> <actinic:block type="ChildSectionList"> <actinic:block type="ProductList" if="%3cactinic%3avariable%20name%3d%22ProductType%22%20%2f%3e%20%3d%3d%200" >$count++;</actinic:block> <actinic:block type="ChildSectionList"> <actinic:block type="ProductList" if="%3cactinic%3avariable%20name%3d%22ProductType%22%20%2f%3e%20%3d%3d%200" >$count++;</actinic:block> <actinic:block type="ChildSectionList"> <actinic:block type="ProductList" if="%3cactinic%3avariable%20name%3d%22ProductType%22%20%2f%3e%20%3d%3d%200" >$count++;</actinic:block> <actinic:block type="ChildSectionList"> <actinic:block type="ProductList" if="%3cactinic%3avariable%20name%3d%22ProductType%22%20%2f%3e%20%3d%3d%200" >$count++;</actinic:block> </actinic:block> </actinic:block> </actinic:block> </actinic:block> echo "Products: $count"; </actinic:block>
<actinic:block php="true">$productsonpage = 0;</actinic:block> <actinic:block type="ProductList"><actinic:block php="true">if ( '<actinic:variable name="ProductName" encoding="perl" selectable="false" />' ) $productsonpage++;</actinic:block></actinic:block> <actinic:block if="%24productsonpage%20%3c%202" > <actinic:block type="ProductList" > <actinic:block type="PriceList" > <actinic:variable name="PriceLayout" value="Compact Tax Inclusive Price" /> </actinic:block> </actinic:block> </actinic:block> </actinic:block>
<actinic:block php="true"> if ($productsonpage < 2) { $html = <<<ENDOFCODE Actinic code goes here ENDOFCODE; // NB this line must not be indented echo $html; } </actinic:block>
<actinic:block php="true">$productsonpage = 0;</actinic:block> <actinic:block type="ProductList"><actinic:block php="true">if ( '<actinic:variable name="ProductName" encoding="perl" selectable="false" />' ) $productsonpage++;</actinic:block></actinic:block> <actinic:block php="true"> <actinic:block type="ProductList" > <actinic:block type="PriceList" > if($productsonpage == 1) { $html = <<<ENDOFCODE <actinic:variable name="PriceLayout" value="Compact Tax Inclusive Price" /> ENDOFCODE; echo $html; } </actinic:block> </actinic:block> </actinic:block>
Comment