Body classes for individual event categories?

Home Forums Calendar Products Events Calendar PRO Body classes for individual event categories?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #31511
    Norine Leibel
    Participant

    Is there a way to target the body classes for individual event categories?

    Here’s what I’m trying to do: I’d like to have a different header image for each event category. I’ve been able to this elsewhere on the site in regular categories, by using body classes and writing the css for that.

    I’m using a child theme of Thematic.

    Thanks.

    #31526
    Jonah
    Participant

    Hey onelittlemoose,

    This should already be in place for you. The body class for a category should be showing up as ‘events-category-CATEGORYNAME’. Is it not? If not you might need to update Thematic or play around with the body class function to get the event categories in there yourself.

    – Jonah

    #31597
    Norine Leibel
    Participant

    Thanks, Jonah. I have investigated further and here is what I learned:

    If the event category name is more than one word (for example – event category is “What’s Happening in Lake Dief”), the body class gets written as follows: tribe_events_cat-what’s happening in lake dief
    Note the absence of hyphens in the class name. I thought at first it was because of the apostrophe, so I created an event category “What is Happening in Lake Dief”. Same problem, body class became tribe_events_cat-what is happening in lake dief … again without the hyphens.

    I tried again with just a one-word category name “dief” and then it worked fine. Body class was tribe_events_cat-dief as expected.

    This does not occur elsewhere in Thematic with multi-word categories, so it seems a result of the Events Calendar. Unfortunately it is big problem, as single-word event categories are not an option. Is there a solution?

    Separate but related, I’d like the individual event to have the same header image as its event category, however the body class in the individual event does not include any event category information. Not sure how to address this. Help?

    Thanks

    #31614
    Norine Leibel
    Participant

    Jonah, a followup to my previous post. It appears that the body classes in the event categories are a product of the way Thematic deals with body classes, as when I created a child theme of twentytwelve, the classes were written as you suggest they should be “events-category-CATEGORYNAME”. So I will need to sort that part out.

    However, with regards to the individual events, which don’t seem to get any a body class regardless of category, is there a way to get the body classes in there? The better question is, can their permalink be in their respective category? For example:
    /whats-happening-in-lake-dief/event-name/
    /whats-happening-in-south-side/different-event-name/
    That would be very helpful as it would match the rest of the site, rather than all the events being thrown into one place under /event/
    It would have the side benefit of having the slug which could be in theory get the body class working.

    Thanks.

    #31615
    Jonah
    Participant

    Hi onelittlemoose,

    Unfortunately we do not have either of these features. The first feature would be fairly easily achieved by filtering the body class function (which you’re going to have to do anyway) and adding a condition to populate the category slug when on a single event.

    As for the permalink structure, other’s have brought this up as well and we do have plans to improve this in a future release but there is no solution as of now.

    I hope that helps and sorry I don’t have more to offer here.

    – Jonah

    #978495
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Body classes for individual event categories?’ is closed to new replies.