• Resolved suziq407

    (@suziq407)


    Howdy,

    I’ve some calendars with exported ICS data from our Nextcloud. Both ICS files are okay with the ICS-Feed-URL-Tester. I want to show each ICS (calendar) with a different color. So my short code looks f.e. like this one:

    [ics_calendar url="https://example.com/cal1.ics" view="month" color="#ff0000"|"https://example.com/cal2.ics" view="month" color="#00ff00"]

    Then data of cal1 will then be shown, but with color of cal2. Data of cal2 are always missing.

    Is there a way to show different calendars with different colors?
    If not … Why not? 😉

    Regards.
    Suzi Q.

    • This topic was modified 1 year, 7 months ago by suziq407.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author room34

    (@room34)

    Your shortcode is not formatted correctly. Each parameter name can only appear once, and the multiple values need to be inside a single set of quotation marks, with pipes between them. Here’s the correct version of the example you gave:

    [ics_calendar url="https://example.com/cal1.ics|https://example.com/cal2.ics" view="month" color="#ff0000|#00ff00"]
    • This reply was modified 1 year, 7 months ago by room34.
    Thread Starter suziq407

    (@suziq407)

    Ok, ok, room34, now I understand the structure behind.
    The result is: It works fine 🙂 🙂 🙂 Many thanks.

    Unfortunately, I have not found such an example anywhere.

    Plugin Author room34

    (@room34)

    I’ll admit it’s hard to write documentation that’s both concise and comprehensive. The multiple feed format is covered on this page:

    https://icscalendar.com/shortcode-overview/

    Because of how WordPress processes shortcodes (which is patterned after standard HTML) it’s not possible to include an attribute/parameter name more than once, so multiple values have to be combined inside a single set of quotes.

    Thread Starter suziq407

    (@suziq407)

    Thank you for your explanation … <3

    @room34 Your documentation seems to be missing the “|” between the hex codes… But either way I’m struggling to get this to work –

    ics_calendar url=”https://url1.com | https://url2.com&#8221; feedlabel=”Main Arena|Warmup Arena” color=”#1E2E5D|#8C0000″

    • This reply was modified 1 year, 4 months ago by michaelehowe.
    Plugin Author room34

    (@room34)

    Some of the parameters support either | or spaces as the delimiter. It doesn’t support using both though, and it looks like you have spaces around the pipe between your URLs, which is probably the issue.

    Just in case this helps others, the reason why my code wasn’t working was WP had added in some <span> elements, which were only visible when viewing the short code in “text” mode rather than visual.

    Plugin Author room34

    (@room34)

    @michaelehowe One thing I’ll add to this: if you’re using the Block Editor, be sure that you use a Shortcode block, rather than just putting the shortcode in a Paragraph block.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Two (or more) calendars with different colors?’ is closed to new replies.