Events Made Easy › Forums › How do I … › …link to the next event?
- This topic has 10 replies, 2 voices, and was last updated 3 years, 5 months ago by Anonymous.
-
AuthorPosts
-
Thu 27 May 2021 at 10:42 #62579AnonymousInactive
Yeah, I am again totally into the plugin right now 🙂 And while using a lot of ideas and questions come up, but most of the time I can help myself with the documentation and the forums.
So I found your suggestion to use pagination and templates to create something like a link to the next event on a single event page.
I modified the
++YYYY-MM-DD
mentioned here and tried with:
[eme_events scope='++#_STARTDATE{Y-m-j}' limit='1' template_id='7']
and this template 7 containing only:
<a href="#_EVENTPAGEURL" title="#_FIELD{Thema}">#_EVENTNAME >></a>
But my scope doesn’t work correctly. It seems alright only during the same/current month. So all the events dated in May showing the next event. As soon as the event is dated in June or in another month, the link leads back to the first event (the next one in May).
Am I doing something wrong? Thinking the wrong way? Or is there some misbehavior in the code?
Thu 27 May 2021 at 11:46 #62582FrankyKeymasterTry #_STARTDATE{Y-m-d} (“j” is incorrect: it formats the day without leading zero, so it doesn’t obey the YYYY-MM-DD format)
Thu 27 May 2021 at 14:53 #62583AnonymousInactiveYes, that was the explanation/solution. One small letter. Thank you.
Sun 30 May 2021 at 23:41 #62614AnonymousInactiveOne more upcoming question. For the last event their will be no next event and so I get the default message from the settings page “No events”. How to change it just for this case and not in general. I would like to have nothing instead but don’t succeed to imagine how to do it. Something like
[eme_if tag='?' value='1'][eme_events scope='++#_STARTDATE{Y-m-j}' limit='1' template_id='7'][/eme_if][eme_if tag='?' value='0']-[/eme_if]
?Mon 31 May 2021 at 11:36 #62621FrankyKeymasterUse the template_id_no_events option for the shortcode eme_events to change that message (or make it empty by either assigning an empty template or in the general eme settings).
Thu 3 Jun 2021 at 10:50 #62641AnonymousInactiveI missed that option till now. Great.
So I changed to
[eme_events scope='++#_STARTDATE{Y-m-d}' limit='1' template_id='7' template_id_no_events='10']
and remarked another curiosity. Because now all the next-event-links link to themselves.But after some testing I came to the conclusion that time is involved. Seems that I checked that functionality only in the late hours of the day. If the event is starting before the current time (the moment I visit the single event page), it will be listed also in my “link list” and if the current time is after the event’s start the link will really show the next event.
Is this possible? What could I do about it?
Another issue: I also tried to create a link to the previous event but can’t make it work. I have the idea that there have to be some scope like today—-YYYY-MM-DD. Because it should not list past events, but all those that are between today and those ending before the start date of the event I am looking at.
Thu 3 Jun 2021 at 12:06 #62643FrankyKeymasterWell, the scope param states for “all events starting later than YYYY-MM-DD”. So one could argue if the time should be checked 🙂 But I believe that due to a new change of mine (where the time is taken into account more) this now results in “later than the beginning of YYYY-MM-DD” and that is not the intention. So this small one-line fix should help (I add the end-of-day time to the check):
Fri 4 Jun 2021 at 08:54 #62651AnonymousInactiveYes, it is working, thanks.
Fri 11 Jun 2021 at 22:16 #62702AnonymousInactiveAfter a few days break I am back on that track 😉
Still working on the backwards link and thinking to be close to a solution. I am wondering why #_SINGLE_EVENTPAGE_EVENTID isn’t giving me the ID as a number but the slug? Is it supposed to be like that? As I kept going on I couldn’t find any documentation about the placeholder for the event slug but was successful with some trial and error: #_EVENTFIELD{event_slug} There is nothing like #_SLUG or #_EVENTSLUG?
Sat 12 Jun 2021 at 09:57 #62705FrankyKeymasterThis fixes that:
https://plugins.trac.wordpress.org/changeset/2546704/Please do open a new thread for questions not related to the initial question.
Sat 12 Jun 2021 at 19:33 #62708AnonymousInactiveThank you, it is working! And okay, I will do on next occasion.
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.