| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Determine what kind of page has been loaded within a template. | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Determine what kind of page has been loaded within a template.
So my design has a very large header image at the top to showcase products. For things like the home page, I just want to show more or less random product images. For categories, I want to display the category image, and for products, I want to display the product image.
But those things all need to be in the same location on the page, so they end up in the same template. The problem is, while I figured out how to show the images I wanted, I can't figure out how to pick which one to display based on the kind of page that has been loaded. I would think I could do something with a condition like: Code:
But I can't find any reference that tells me what conditions are available to check.
__________________
Version: 5.3.3.3 |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: Determine what kind of page has been loaded within a template.
After some translation, I was able to get the effect I needed:
Code:
Looks like I can just compare with the names of any file in classes/XLite/Controller/Customer for all the various possible page types.
__________________
Version: 5.3.3.3 |
|||||||||
|
#4
|
|||||||||
|
|||||||||
Re: Determine what kind of page has been loaded within a template.
Controller class names don't translate to target names directly, but the idea is correct.
Targets like "product_options" will translate to "ProductOptions" controller class name. Also, classes/XLite/Controller/Customer is not the only place for controller classes. Modules may have their controllers too. So, you should look into classes/XLite/Module/*/*/Controller/Customer directories too.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
|||
X-Cart forums © 2001-2020
|