Events Made Easy › Forums › Bug fixed or feature request implemented › is there a way to generate css for describing past vs future single events?
- This topic has 6 replies, 2 voices, and was last updated 13 years, 9 months ago by Anonymous.
-
AuthorPosts
-
Sun 19 Dec 2010 at 22:09 #42297AnonymousInactive
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
Sun 19 Dec 2010 at 23:03 #45618FrankyKeymasterYou 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.Mon 20 Dec 2010 at 17:35 #45619AnonymousInactivesorry, 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”.
Mon 20 Dec 2010 at 19:53 #45620FrankyKeymasterI see … I’ll try to include a CSS to indicate past/present/future events for the next version
Fri 24 Dec 2010 at 23:20 #45621FrankyKeymasterThis 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 wantedSat 25 Dec 2010 at 00:41 #45622AnonymousInactivepretty 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.
Sun 20 Feb 2011 at 00:00 #45623AnonymousInactiveFranky, 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;}
-
AuthorPosts
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.