Support

Home Forums Event Espresso Premium Colors for Events in Multiple Categories

Colors for Events in Multiple Categories

Posted: September 9, 2014 at 10:22 pm


The Dirty Easel

September 9, 2014 at 10:22 pm

I have been reading through the forums and finding lots of people with the similar issues, but not a definitive solution.

Calendar is here: https://thedirtyeasel.com/calendar/

In order to be able to have some events not show up on this calendar (but still allow people to register for them with a direct link to that event) we have the categories “Public” and “Private” and the shortcode used for this calendar is:

[ESPRESSO_CALENDAR event_category_id="public"]

So that it will only show events in the Public category.

But then we also have a category for each venue, for the sole purpose of allowing each venue to have its own color. The colors for the venue categories are the only ones we want to show on the calendar.

I am getting tons of bugginess in getting it to show the venue colors instead of the default color.

Under theme settings: Enable CSS for Categories -> is set to Yes.
Use Color Pickers -> is set to No.
Under Memory management: Disable Categories -> is set to No.

The event you see in the Whip In category is correctly purple – which is the color set for the whipin category. The purple color is in the inline styles. Great!

The event you see for Thai Fresh, which is in the thaifresh category, should be yellow, but it wasn’t until I changed its venue (the venue, not the category) to Whip in, then changed it back to Thai Fresh. Somehow that jump started it to use the right color. Great!

ANYWAY, the last bit of bugginess I can’t get past – if you go to October you can see a recurring event on Tuesdays. They are in the abelsnorth category, which should be red. (The single, non-recurring event in September in that category is the right color.) When I created that recurring series of events, they WERE the right color, red. But then I had to make an edit to the times, and when I saved it, BAM, they all turned to the default blue. All I changed was the start and end time, but now the inline style is gone on them.

What is a girl to do?


Lorenzo Orlando Caum

  • Support Staff

September 10, 2014 at 8:22 am

Hi,

If you modify a set of recurring events, then this will change the settings for this group of events. You would need to edit the events to re-assign them to your color-coded categories.


Lorenzo


The Dirty Easel

September 10, 2014 at 9:01 am

They *are* all in the color-coded category. That didn’t change. I even tried opening each inidividual event, checking to make sure each one was in the category, and Saving again. I tried removing one from the category, saving it, and then adding it to that category again and saving it. Nothing seems to make it grab the inline styles again.


Josh

  • Support Staff

September 10, 2014 at 10:36 am

Hi Jenny,

The definitive solution for specifying a background color for an event with multiple categories involves adding some CSS to your theme or custom stylesheet. The calendar documentation has a section that outlines how:

https://eventespresso.com/wiki/events-calendar-add-on/#colors


The Dirty Easel

September 10, 2014 at 10:41 am

Hi Josh! I have gone through that section, but the problem is I have to release this to a client who will be adding new categories/venues all of the time, and I can’t really ask her to edit the css. It seems like there is a bug at work here where the inline styles are not added in reliably. In my case, after I made an edit to a recurring event.


Josh

  • Support Staff

September 11, 2014 at 11:26 am

Hi Jenny,

I can suggest an alternative solution to set Private events so they don’t display on the calendar *and* ensure the event’s color on the calendar works as expected.

Instead of assigning the Public events to a Public category, and Private events to a Private category, you can set the Private events to have a Waitlist status. An event with a waitlist status will allow for signing up and paying for just like a regular event, but it will not be displayed on the calendar.

Then, you can remove the events from the Public category and remove the category parameter from the Calendar page’s calendar shortcode. Once all of the events are assigned to one category only the colors will display as expected.

The reason that you’re having trouble with the colors as expected is because when the calendar add-on grabs the event info, specifically the categories, it grabs an array of categories (if there’s more than one category assigned to the event) and uses the array_shift PHP function to return the first category in the array. Since the array can be ordered any which way (as you’ve seen after saving events a few times) the first category in the array isn’t always the one you might want as the color designator.

One other thing: You can make it so the Event Status option in the event editor’s status selector reads as “Private” instead of “Waitlist” by using a translation function. This will help avoid confusion when they set up their Private events.


The Dirty Easel

September 11, 2014 at 12:59 pm

“Waitlist” is exactly the tool I needed! Thank you!


Dean

September 12, 2014 at 3:36 am

If you need any further assistance please let us know.


Josh

  • Support Staff

January 15, 2015 at 9:42 am

Hi Jenny,

Calendar 2.2.5.p (for Event Espresso 3) is available for download and includes a new feature where it sorts the categories by name before it sets the color. This allows for more consistency when it matches a color to an event based on the categories selected for an event.

The support post ‘Colors for Events in Multiple Categories’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso