I have a ecommerce site that has Products and Accessories. O n the "store" page it loads all of the products and accessories. I want to load the products on the product section and the accessories on the accessories section on the page. Is there a way to detect the folder and have it load the accessories in the appropriate section of the same page?
tonjaggart wrote: I have a ecommerce site that has Products and Accessories. O n the "store" page it loads all of the products and accessories. I want to load the products on the product section and the accessories on the accessories section on the page. Is there a way to detect the folder and have it load the accessories in the appropriate section of the same page?
It would take a little javascript (or jQuery, for ease), I think, but it's doable. Say that you have <div id="products"> and <div id="accessories">
- Code: Select all
<cms:pages masterpage="store.php" >
<cms:if k_folder_name = 'products' >
<script>
$('#products').append("<cms:show productinfo /> or what have you");
</script>
<cms:else_if k_folder_name = 'accessories' />
<script>
$('#accessories').append("<cms:show accessoryinfo /> or such");
</script>
</cms:if>
</cms:pages>
I haven't tested it, but it should work assuming that Couch tags and Javascript play well together (and they have thus far for me), but as it's just putting the raw text in the <div>, it should.