Different colors for every category

  • TheAnt
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 8 months ago #153284 by TheAnt
Different colors for every category was created by TheAnt
Hello, is it possible to assign a different color for every category? I mean color for event title or event background, so for example all events fron Category A have red title and all events fron Category B have green title.
Thanks

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

More
1 year 8 months ago #153298 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Different colors for every category
Hello

For each category, it is already possible to setup background color and color. But these color setup will only work for calendar

If you want it to be applied for other pages, customization to the code will be needed

Regards,

Tuan

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

More
1 year 5 months ago - 1 year 5 months ago #154366 by Dol
Replied by Dol on topic Different colors for every category

If you want it to be applied for other pages, customization to the code will be needed
 

If these other pages are called from menu, you can add a Page Class in menu item settings and customize colors from your custom css file.
Last edit: 1 year 5 months ago by Dol.

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

  • TheAnt
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 months 4 days ago #158876 by TheAnt
Replied by TheAnt on topic Different colors for every category
Hi, there is no way to add a class to every category?

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

More
10 months 4 days ago #158877 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Different colors for every category
Where do you want to add that class? Could you send us link to the page which you are talking about ?

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

  • TheAnt
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 months 4 days ago #158878 by TheAnt
Replied by TheAnt on topic Different colors for every category

Where do you want to add that class? Could you send us link to the page which you are talking about ?

 
I'm testing it here: www.festivaldelparcodimonza.it/le-edizioni/2023/calendario
I wish to assign a different color (or icon)  for every category, so event title in events list has that color (or icon)

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

More
10 months 4 days ago #158887 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Different colors for every category
Hello

If you view source of that page, each event is rendered inside a div which has css class contain ID of the category. For example eb-category-13, eb-category-11

Base on that css class, you can add custom css to style events of each category in the way you want

It even contain ID of the event in the css class, like eb-event-141, eb-event-140, so you can even apply custom style for individual event if needed

Regards,

Tuan
The following user(s) said Thank You: TheAnt

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

  • TheAnt
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 months 4 days ago #158892 by TheAnt
Replied by TheAnt on topic Different colors for every category
Tried this to style event title:
div.eb-category-11 h2.eb-event-title.pull-left {
color: rgba(223, 155, 27, 1);
}
don't work, what am I doing wrong?
Thanks

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

More
10 months 4 days ago #158893 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Different colors for every category
Maybe that rule does not have higher priority than the existing one. Try to add !important to see if it works

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

  • TheAnt
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 months 4 days ago - 10 months 4 days ago #158894 by TheAnt
Replied by TheAnt on topic Different colors for every category
This works:
div.eb-category-11 h2.eb-event-title.pull-left, div.eb-category-11 h2.eb-event-title.pull-left a {
    color: rgba(223, 155, 27, 1)!important;
    font-weight: bold;
}



Thanks a lot
Last edit: 10 months 4 days ago by TheAnt.

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