WordPress.org

Ready to get started?Download WordPress

Forums

WP FullCalendar
[closed] Colours not used on all events (15 posts)

  1. Beee
    Member
    Posted 8 months ago #

    I installed WP Full Calender to colour my events used with the events manager plugin.

    I added 2 colours to my categories race (red) and freeride (green) and expected all events to use that colour, but it's not consistant.

    Current month:
    The only event which is coloured is the freeride. The races (which should be red) don't have any colour.
    http://i.imgur.com/YXfnFKY.jpg

    Next month:
    Only 1 race is red. The second one has no colour.
    http://i.imgur.com/Bxh86ih.jpg

    Don't know why this happens.

    http://wordpress.org/plugins/wp-fullcalendar/

  2. Beee
    Member
    Posted 8 months ago #

    I just came to the conlusion that it might be because each event has multiple categories.

    My directory structure is as follows:
    Discipline
    - Classic luge
    - Drift trike
    - Gravity bike
    - Inline
    - Standup
    - Street luge
    Event type
    - Freeride (#ceeecc)
    - Misc
    - Race (#e5454a)

    Can it be that the colour is overwritten by a category which colour isn't defined (by me) ? And if so, how to prevent it ?

    I only want to colour the event types, not the disciplines.

  3. angelo
    NetWebLogic Support
    Posted 7 months ago #

    did you have multiple category in one event?

  4. Beee
    Member
    Posted 7 months ago #

    yes....
    one for discipline, one for event type

  5. Beee
    Member
    Posted 7 months ago #

    can you maybe tell me how the categories are identified uniquely ?

    I have a custom css template which is loaded last in the header, so anything I define there overwrites any previous values in css.

  6. Beee
    Member
    Posted 7 months ago #

    I just found out the colours are hardcoded.

    I see two colours, because there is only 1 category colour defined (of 3 used categories, but since 2 are white, I think the code only shows white only once.)

    I see this being used.

    <div class="fc-event-inner fc-event-skin" style="background-color: rgb(229, 69, 74); border-color: rgb(229, 69, 74); color: rgb(255, 255, 255);">

    Isn't it an idea to give each item a unique class like post_class() ?
    Instead of just "fc-event-inner fc-event-skin" because this doesn't identify an event uniquely.

    In my case this event would then have 3 categories;
    1) category-slug1
    2) category-slug2
    3) category-slug3

    <div class="fc-event-inner fc-event-skin category-slug1 category-slug2 category-slug3"

    These can all be identified uniquely through a stylesheet.

    I think it's a good idea to include tags here as well.

    The other idea is to only define a colour when the value is set. So upon initialization, the category (bg) colour should read none, instead of white. If the value is none, it shouldn't be hardcoded.

    Anyway that's my 0,02...

    If anyone knows a way to hook in a custom piece of code for it, I'm interested.

  7. AJD
    Member
    Posted 7 months ago #

    I just posted a similar question here.

    I agree that your suggestions would help, either by adding a class for the category, or defining a color only when the value is set.

    So far I haven't figured out a way to precisely set colors when multiple categories are used.

    Even when only one category is used, it appears that the parent category overrides the child, which seems backwards to what I want.

    parent-cat (RED)
      child-cat (BLUE)
    2parent-cat (black)
      2child-cat (white)

    If the an event has both 'parent-cat' and 'child-cat' assigned its color will be RED.

    However if it has parent-cat, child-cat and 2child-cat assigned it will be white.

    EDIT: my second line of logic seems to be off. The color assignment is not consistent when a second child category is used. Maybe it is alphabetical or in order of category creation?

    EDIT: It appears as though the hierarchy of category colors is determined by the alphabetical name of the category.

    IF:

    boats (black)
        big (white)
        small (blue)
    yachts (green)
        yachts-small (pink)

    Than:
    If 'big' is assigned the color will always be white, no matter the other categories assigned.

    The only way to make the category 'pink' color to show up is if 'yachts-small' is the only category assigned.

  8. Beee
    Member
    Posted 7 months ago #

    Yeah, i think so, but I don't want that...

    each event needs a type; race, freeride, misc
    and it needs one or more disciplines.

    I'm only looking to colour the disciplines for now.

  9. AJD
    Member
    Posted 7 months ago #

    Agreed, I would like full CSS control of the colors.

    I figured out a way to work around it for now. It's definitely not optimal, but it works.

    I created an additional category for each color that I want to use. I set the color and started the title with a number to ensure that it will always be first alphabetically.

    0ColorsCategories
        1red
        2blue
        3green

    Then assign those categories to events.

    Then I used this snippit in functions.php to exclude the new categories from the 'All Event Categories' dropdown list.

    // if we need to exclude things from the dropdown category menu on the calendar page
    function em_wpfullcalendar_category_label($taxonomy_args,$taxonomy){
     if ( $taxonomy->name == 'event-categories'){
      $taxonomy_args['exclude'] = '90,55,109,24,114'; // categories to exclude
     }
     return $taxonomy_args;
    }
    add_filter('wpmfc_calendar_taxonomy_args','em_wpfullcalendar_category_label',1,2);

    There are a few other places to exclude the color categories as well. `[fullcalendar category="-190,-55,-109,-24,-114"]
    [events_list category="-90,-55,-109,-24,-114"]`

  10. Beee
    Member
    Posted 7 months ago #

    I appreciate the time you took to create a solution but I find this too much hassle, the more since this is too much work for just adding a simple colour, with an option partially there...

    imo it needs some tweaking

  11. Beee
    Member
    Posted 6 months ago #

    I just hope Marcus has read this topic...

  12. AJD
    Member
    Posted 6 months ago #

    I submitted a feature request on this, asking for more fine-grained category color handling.

  13. Beee
    Member
    Posted 6 months ago #

    did you get an answer and if so what was it ?

  14. AJD
    Member
    Posted 6 months ago #

    Nothing conclusive, yet.

  15. fquiquet
    Member
    Posted 5 months ago #

    Need a solution too for that.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic