Support » Plugin: The Events Calendar Category Colors » Primary category / color when multiple categories selected

  • Resolved Peter.Ingersoll

    (@peteringersoll)


    Hello,

    My client selects multiple categories for events. They have asked for the ability to choose the primary category and use that as the category color in the calendar.

    From what I can tell, events are given the CSS class for the category colors in the alphabetical order of the categories. Therefore, category “Zulu” category will always override category “Alfa” as the “Zulu” category class/css color will be used.

    Ideal would be to have an option to set a primary category (for example, similar to what is used in the Yoast SEO plugin or other primary category plugins) and then colors for that category would be displayed.

    Another option might be to set a “this trumps that” order. I can use a taxonomy order plugin, but then the legend shows the categories in the custom order, rather than alphabetical. Or reversing the order of reordered categories could work in this scenario, putting the most important category first in the legend but last in the CSS class order.

    Or perhaps sort CSS classes by slug and legend by category name, and then change the slugs to go in the desired order.

    Any feedback or suggestions is greatly appreciated.

    – Peter

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Andy Fragen

    (@afragen)

    Peter,

    In the current version you can have 2 colorized categories where one has a border and one has a background and the event with both of these categories will have both the border and the background.

    You cannot stylize 2 events with the same CSS selector match differently, the last declared style will prevail. That’s where the ‘Cascading’ comes from 😉

    In the current plugin a primary category could be the background and a secondary category could be the border, or visa versa.

    Obviously you cannot have more than one primary or secondary category per event but you can have other categories per event that are hidden (select Hide in the Settings) and colors aren’t applied.

    I hope that makes sense.

    Andy

    Thread Starter Peter.Ingersoll

    (@peteringersoll)

    Andy,

    That makes perfect sense – I completely understanding the cascading aspect.

    I’m looking for a way to either add a primary “flag” (adding a “primary” style or “!important” to the CSS) or change the order of the cascade so, at the very least, I can rank categories so that the most “powerful” category is cascaded last.

    – Peter

    Plugin Author Andy Fragen

    (@afragen)

    I believe the only way is to rearrange the category terms.

    Refer to this issue, https://wordpress.org/support/topic/legend-category-order/

    There is no way to add a primary/secondary modifier to the category. The only way I can think of is as previously described by having the primary be a background and the secondary be a border. Obviously an event cannot have 2 primaries or 2 secondaries.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Primary category / color when multiple categories selected’ is closed to new replies.