Are you enjoying the extensions? Did you like the support? Help others decide.

Leave a review

file How To Give Each Category an ID

More
2 years 8 months ago #5477 by MyWorld
How To Give Each Category an ID was created by MyWorld
I am using different categories and sometimes I want a bit of a different style for each category.  Is there a way to give each category an ID?

Thanks!

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

More
2 years 8 months ago #5484 by syw
Replied by syw on topic How To Give Each Category an ID
You can already differentiate contacts by category.

Each contact has classes:
person
personid-{the contact id}
catid-[the category id]

You can use those classes and CSS to modify the look of your contacts depending on the categories they belong to.

For instance, use

.person.catid-10 { font-size: 10px }

to change the font size of contacts being members of the category that has id 10.

Olivier.

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

More
2 years 8 months ago #5485 by MyWorld
Replied by MyWorld on topic How To Give Each Category an ID
I see the personid-## and the catid-## via Firebug, that you are referring. I was hoping that there would be an ID on the DIV that contains the contacts. For example, in the form#trombinoscopeForm, you would have something like this:

<div id="personlist" class="personlist">

Maybe we could add the ID via the category in the backend. I'm not as smart as you so you would know how best to do it but I think each category should have it's own ID.

Thanks :)

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

More
2 years 8 months ago #5486 by syw
Replied by syw on topic How To Give Each Category an ID
It's not possible to add a category id to personlist since personlist can be a group of contacts from different categories. That would only work if contacts were of the same category. In which case, why the need to differentiate by category?

If you are using modules, each module instance has its own id, that is how you can differentiate several module instances on a page. If contacts are of the same category in each module instance, it's easy to differentiate them from each other.

To change the look of contacts with different categories in a single module instance or in a menu item, catid_[id] is the only way to go.

Olivier.

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