Support » Plugin: My Calendar » Mini calendar – Event titles with category color as background

  • Resolved Dr_jAcKaSS



    I have just upgraded from version 1.1.9 to the most recent version of My Calendar (2.2.5).

    With an upgrade background colors of event titles in Mini calendar are not showing in corresponding category colors.

    What concerns the Grid calendar view, this works as it should (and did).

    What may be the problem?

Viewing 5 replies - 1 through 5 (of 5 total)
  • A closer look to CSS reveals that the following CSS is not generated:

    .mc-main .mc_custom-category-name .event-title a {
    background: #fffdd4;

    So there must be some sort of scripting error that should generate this CSS, but it does not.

    (It is not the CSS issue such as overriding a CSS rule with my style sheet).

    Plugin Author Joe Dolson


    The mini calendar does not include an anchor element in the event title by default, so that CSS does not apply. You can configure the event title to include a link (such as to an event details page), in which case the CSS will apply automatically.

    Thanks Joe!

    I have get back to this after a while, since I was short on time then.

    I would suggest changing the line 156 in my-calendar-core.php:
    $category_styles .= "\ .$class .event-title a { $type: $color; $inv }";
    $category_styles .= "\ .$class .event-title { $type: $color; $inv }";

    I have removed the anchor element from CSS. If you use {title_link} in settings for event title, the link is generated only if there is an URL set, which is a correct behaviour. But I believe the category background color should be set to title irrespective of whether the title is a link or not.
    Presently the background is coloured only if title is a link, otherwise not.

    Plugin Author Joe Dolson


    I won’t be making that change, because the majority case for this output is that the event titles are links — and the example you provide would only apply when they aren’t links, because the style sheet cascade doesn’t descend to anchors for color.

    I will look into automatically detecting whether there’s a link or not, to switch that, but definitely can’t just make the assumption that there’s no link, since it’s the more unusual case.

    According to my test, by making this little change the background color is set for both cases – whether it is a link or not.

    Well, next line may also be slightly altered if you want to change the background on mouseOver (focus), but this is more or less a CSS thing, depends on what effect would you like to have.

    Personally I use different effect for hover, so I have turned off background-color change by adding the following CSS to my stylesheet: .event-title a {
    background-color: inherit !important;
    } .event-title a:hover {
    background-color: inherit !important;

    But the later is of course adjusted to my template needs.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Mini calendar – Event titles with category color as background’ is closed to new replies.