conditional based variation on views

  • Posts: 14
  • Thank you received: 0
13 years 7 months ago #12102

Hi,
I would like to make some small variations on the way a product listing is shown based on the category that is rendered.

All this using the same “listing_img_title.php” view, because for big variations I will just override a different view (and I think a may need them all).
I have created a category call “Outlet” and I want that when the user click the associate menu it will display the same “listing_img_title.php” I use for the other menu entries but with a little image in each product with the word “Outlet”.

What I don´t know is the php code to make get the current category name.

$category_name=(I don´t know how to query this)
If ($category_name==’Outlet’){
/* rendering the outlet image */
}
I appreciate any help.
Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12106

Hi,

You will find all the current category information in the variable $this->element.

So, for the name it's: $this->element->category_name

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
13 years 7 months ago #12136

Great it worked!!!
thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum