• Resolved MikeShand

    (@mikeshand)


    Is there an [if-not-description] or [if-no-description] conditional tag? I want to write something if and only if there is no description. My particular problem is that if there IS a desription (using html description) it always inserts a blank line after the description, so if I have event1 with a description and event2 without, I get in my listing

    event1title
    event1times
    event1description

    event2title
    event2times
    event3title
    event3times
    etc.

    i.e. events with a description are separated from the next event, but those without aren’t.

    If I insert a new line before or after each event, then of course I get double new lines if there is a description.

    So I want to write something like
    [if-no-description][break][/if-no-description]

    Is there some other workaroound? Other than going to the trouble of inserting dummy description in all the calendar entries?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Nick Young

    (@nickyoung87)

    Hello,

    First off I apologize for the delay.

    There actually is an [if-description][/if-description] tag pair that you can use.

    You can find all of the event template tags here: https://docs.simplecalendar.io/event-template-tags/

    Thread Starter MikeShand

    (@mikeshand)

    Thanks, but I already know about that. What I need to solve my problem is if-not-description or it’s equivalent. I.e. I need to insert something (a break) if there is no description. Alternatively if I could remove the break after a description that would solve it. But I can’t think how to do that. See original post.

    Mike

    Plugin Contributor Nick Young

    (@nickyoung87)

    Oh sorry I think that it might not work correctly with just the description tag. I am pretty sure the the description is wrapped in a <p> tag which would be causing the line break. You might be able to get rid of that by turning the html="yes" attribute of the tag on possibly. You would have to test that and see if it works though, as I am not 100% sure off the top of my head.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘if-not-description’ is closed to new replies.