My Calendar
[resolved] Mini calendar - Event titles with category color as background (6 posts)

  1. Dr_jAcKaSS
    Posted 2 years ago #


    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?


  2. Dr_jAcKaSS
    Posted 2 years ago #

    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).

  3. Joe Dolson
    Plugin Author

    Posted 2 years ago #

    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.

  4. Dr_jAcKaSS
    Posted 2 years ago #

    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 .= "\n.mc-main .$class .event-title a { $type: $color; $inv }";
    $category_styles .= "\n.mc-main .$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.

  5. Joe Dolson
    Plugin Author

    Posted 2 years ago #

    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.

  6. Dr_jAcKaSS
    Posted 2 years ago #

    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:
    #jd-calendar.mc-main .event-title a {
    background-color: inherit !important;
    #jd-calendar.mc-main .event-title a:hover {
    background-color: inherit !important;

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • My Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.