Okay
  Public Ticket #3628710
How to show scheduled and ongoing events in box grid view?
Closed

Comments

  • edgars_juberts started the conversation

    How to show scheduled and ongoing events? 

    I have an event that is going for lets say 10 days.

     In the box grid view or any view I want to display all the events at the current day and the dates after, that are scheduled. 

    But if I do that i get that event (event for 10 days) 10 times in box grid view! 

    I want it only to be displayed one time so it wont spam the box grid with the same event for 10 days. 

    The event for 10 days should be visible till it expires, but it should be visible only ONE time, not 10. 

    Is there a way to do that?

  •  877
    Zhivko replied

    If you have an event that lasts 10 days it should by default display only once, not 10 times.

    Could you provide me with link to take a look at the front-end?

    To display events started in the past but still running you can add minmax_intersect=true 

    to the shortcode.

    Example:

    [stec min_date=now minmax_intersect=true]

    This parameter is available since version 5.2.5.


    Stachethemes Developer

  • edgars_juberts replied

    I will simplify it. I want to have only ongoing events and events that are scheduled and i dont want to show expired events. 

    [stec min_date=now minmax_intersect=true]

    I tried this shortcode, but it does not show my ongoing event that started on april 2, and is still ongoing till may 3.
    I am using version: 5.2.9

  •  877
    Zhivko replied

    Could you provide me with link to the front-end?


    Stachethemes Developer

  •  1
    bjornbusen replied

    Hi, 

    I have the same issue and can't get the minmax_intersect shortcode to work. I run version 5.2.13. It would be great to be able to show ongoing events.

  •  877
    Zhivko replied

    Paste me the shortcode you're using and attach me an .ics file of your events to test it.


    Stachethemes Developer

  •  1
    bjornbusen replied

    Hi Zhivko,

    wow, that was an instant reply! 

    The shortcode: [stec_events_list filter_calendar=163 order=asc min_date=now max_date=2_years_ahead limit=3 minmax_intersect=true]

    The web address to the ongoing event: https://jonstenberg.se/event/elmia-polymer-2024/

    The web page where it doesn't show up: https://jonstenberg.se/

    The ics file is attached as a zip file.

    Thanks // Björn

    Attached files:  Events.zip

  •  877
    Zhivko replied

    I assume you don't see any events with this shortcode?

    filter_calendar is wrong

    it should be filter__calendar


    Stachethemes Developer

  •  877
    Zhivko replied

    This is what I get as a result:

    8550304697.png

    with minmax_intersect=false I get:

    4283356583.png



    Stachethemes Developer

  •  1
    bjornbusen replied

    Oh yes, the shortcode is working. But I only see upcoming events, not ongoing.

    I'll try to add an extra underscore.

  •  877
    Zhivko replied

    So you don't  see the event on 14 may?


    Stachethemes Developer

  •  877
    Zhivko replied

    Try clearing your browser cache ( ctrl + f5 on chrome )


    Stachethemes Developer

  •  1
    bjornbusen replied

    Hm, that is exactly what I want. But why doesn't it show up om this page: https://jonstenberg.se/ ?

  •  877
    Zhivko replied

    Please add 

    events_prefetch=false 

    for now


    Stachethemes Developer

  •  1
    bjornbusen replied

    Yes, it was a cache thing. I had to purge it several times, in Wordpress backend as well as the browser cache. 

    Thanks for your help! 

  •  877
    Zhivko replied

    I've found the problem and it will be fixed in the next update.

    Meanwhile I can provide you with instructions how you can fix it by yourself.

    It seems that when prefetch events is turned on the minmax_intersect parameter is not being passed to the query.

    FIX:

    1) Open file /includes/shortcodes/shortcode.stec_events_list.php

    2) Go to line 170. You will see this code:

    8849303402.png

    3) At the beginning add:

    'minmax_intersect'          => 'minmax_intersect',

    like this:

    1234539250.png



    Stachethemes Developer

  •  1
    bjornbusen replied

    Thanks!

    One more question though: is this shortcode supposed to work even for the grid view? I have the same issue here: https://jonstenberg.se/om/jon-stenberg-event/

  •  877
    Zhivko replied

    Yes, when prefetch events option is turned off. 

    I've just found out this bug and will try to fix it as soon as possible.

    FIX:

    Similarly to the previous one.

    1) Open file: includes/shortcodes/shortcode.stec.php

    2) Line 307:

    3489309265.png

    insert on the first line:

    'filter__minmax_intersect'  => 'minmax_intersect',

    like this:

    2327736490.png



    Stachethemes Developer

  •  1
    bjornbusen replied

    Great Zhivko! Thanks a lot!