Events Made Easy Forums Bug fixed or feature request implemented is there a way to generate css for describing past vs future single events?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #42297
    Anonymous
    Inactive

    i’m hoping to include soemthing in my “default single event format” that will generate a CSS class, conditionally based on whether this event is a past or future event. It would generate a div like this:

    <div class="past">...entire event goes here...</div>

    This way I can selectively display content divs that are relevant to past or future events — for example, i could do this

    <div class="past">
    ...<div id="tickets">
    ...click to buy tickets
    ...</div>...
    </div>

    combined with this

    .past #tickets{display:none;}

    I currently think i’ll have to insert some php into my “default single event format” that compares today’s date with the event date and creates a class based on that. Has anyone done this before? I’m open to any other ways of doing this, too. Whatever works.

    I’m actually using an old version (2.0x) of Events Manager — NOT EME, but I don’t think that changes much in this case.

    Thanks

    #45618
    Franky
    Keymaster

    You can use your own div around [events_list scope=past] and another around [events_list scope=future], there’s no prob having both on one page.

    #45619
    Anonymous
    Inactive

    sorry, to clarify: i’m looking to conditionally wrap a class around single events

    — In my version of Events Manager, these are generated dynamically using formatting (html etc — I assume you could put php here too if you wanted) that you put in a Events Manager Settings textbox called “default single event format”.

    #45620
    Franky
    Keymaster

    I see … I’ll try to include a CSS to indicate past/present/future events for the next version

    #45621
    Franky
    Keymaster

    This has been implemented in trunk as a new placeholder: #_PAST_FUTURE_CLASS

    You can use this in any formatting setting to indicate past or future events (or use it as a css class indicator), eg in the default event list format:

    <li class="#_PAST_FUTURE_CLASS">#j #M #Y - #H:#i<br/> #_LINKEDNAME<br/>#_TOWN </li>

    I first started out adding a extra <div class=...> around each list element, but a div can’t be used as a child tag of <ul>, and since we don’t know the formatting configured by the user, I let him add it if wanted

    #45622
    Anonymous
    Inactive

    pretty cool, Franky, thanks for that.

    that certainly works for my needs; however, for everyone else, i’m a big fan of putting descriptive classnames all over the place. there are usually ways of sprinkling class names around without adding extra div tags. i’m not sure how this actually works out in context (i do see what you’re saying about putting divs inside ul, which is a recurring problem for me) — i’ve just been thinking lately that a lot more things should have descriptive classnames. i’ve been using the thematic theme framework, and those guys are crazy about classnames — it’s a real time saver.

    my two cents. thanks again.

    #45623
    Anonymous
    Inactive

    Franky, just noticed that there’s a past event showing with eme-future-event here http://bit.ly/gzK5Pl. At first I thought maybe past & future were just swapped, since the majority of past events are marked as future. But looking through all of feb/march, it’s actually pretty unpredictable. So I think it’s a bug.

    HINT: If you’re looking through several events on my site, the ones with the Buy Tickets button are marked as future events. The other ones have same buttons with

    .eme-past-event .whatever {display:none;}

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.
Scroll to Top