If you’re given the assignment to customize Web Store you might start out with the feeling that you are limited in what you can do as far as Web Store’s templating system goes.
We all know by now that each tpl.php in each template package – Deluxe or Framework – is included by one main file: index.tpl.php. That means that this file runs the whole show for every section of the online store. This means that if you add a block to index.tpl.php and you don’t know how to use PHP to hide it and you don’t want it to show on every section, it will.
Luckily, we can use the unique form ID that Web Store creates for Categories, Products, Cart and Checkout and more.
Because the form element that generates a unique ID is listed in the document right after the body element we can use it like we would use a unique id or class in the body element.
-
List of XLSWS Form IDs:
- #xlsws_product = a single product details page
- #xlsws_category = a single category page
- #xlsws_cart = the edit cart page
- #xlsws_checkout = the checkout page
- #xlsws_gregistry = a single wishlist page
- #xlsws_myaccount = an account page
- #xlsws_custom_page = a single custom page
- #xlsws_sitemap = the site map page
- #xlsws_contact_us = the contact us page
Practical application:
Say you’ve got a block of content and you added it to index.tpl.php but for whatever reason you don’t want this content to show on a single product details page.
You could add this to webstore.css
[css]
#xlsws_product #block-you-dont-want-toshow {display:none;}
[/css]
Try it out for yourself & good luck with all your projects!