Events Made Easy Forums How do I … …link to the next event?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #62579
    Anonymous
    Inactive

    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?

    #62582
    Franky
    Keymaster

    Try #_STARTDATE{Y-m-d} (“j” is incorrect: it formats the day without leading zero, so it doesn’t obey the YYYY-MM-DD format)

    #62583
    Anonymous
    Inactive

    Yes, that was the explanation/solution. One small letter. Thank you.

    #62614
    Anonymous
    Inactive

    One 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] ?

    #62621
    Franky
    Keymaster

    Use 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).

    #62641
    Anonymous
    Inactive

    I 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.

    #62643
    Franky
    Keymaster

    Well, 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):

    https://plugins.trac.wordpress.org/changeset/2541912/

    #62651
    Anonymous
    Inactive

    Yes, it is working, thanks.

    #62702
    Anonymous
    Inactive

    After 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?

    #62705
    Franky
    Keymaster

    This fixes that:
    https://plugins.trac.wordpress.org/changeset/2546704/

    Please do open a new thread for questions not related to the initial question.

    #62708
    Anonymous
    Inactive

    Thank you, it is working! And okay, I will do on next occasion.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top