Keyword

Different Class to category Items

  • Ali Can
  • Ali Can's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 1 week ago #132376 by Ali Can
Different Class to category Items was created by Ali Can
I want to learn if it is possible to assign different classes to each category item in listing

I want it to give different css to each individual item.

1. item will have K2item-1 2. item will have K2item-2 etc.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 5 days ago #132377 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Different Class to category Items
Yes through template overrides.

You can echo the category name or id or even a pattern in the the #K2container element as classnames.

More about template overrides can be found here: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Ali Can
  • Ali Can's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 5 days ago #132378 by Ali Can
Replied by Ali Can on topic Re: Different Class to category Items
I opened and add

<div class="hizmet<?php echo $this->item->id; ?>"

so I will have unique class to all my items in categori listing


thanks for the itemid idea :)

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 4 days ago #132379 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Different Class to category Items
This will produce a different class per item.
You can also echo the category's id, to have a more common and generic class.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum