Jump to content
SwimToWin

Mixing one-time events and recurring events in one Event list

Recommended Posts

Hi, I am in the process of creating a local news site, based on ProcessWire.

Among other things, the site will be presenting local events, and I have a question specifically about recurring events.

Events (recurring or not) shall be shown in *one* list, like in this example:

  • 10.01.2019 19:30 - Some event (Page #1235)
  • 11.01.2019 17:15 - Another event (Page #1237)
  • 12.01.2019 16:00 - The Final Event (Page #1239)

When I have recurring events, I would like to keep these on the same page (using a Repeater field) as shown here:

  • 10.01.2019 19:00 - A Star is Born film, showing in Cinema ABC (Page #1234 holds all occurrences)
  • 10.01.2019 19:30 - Some event (Page #1235)
  • 11.01.2019 19:30 - A Star is Born film, showing in Cinema ABC (Page #1234 holds all occurrences)
  • 11.01.2019 17:15 - Another event (Page #1237)
  • 12.01.2019 20:00 - A Star is Born film, showing in Cinema ABC (Page #1234 holds all occurrences)
  • 12.01.2019 16:00 - The Final Event (Page #1239)

The editing interface will use these fields:

  • id
  • title
  • date_start - a datetime field (use for one-time events)
  • time_start - a text field
  • dates - Repeat field with these sub-fields:
    • date_start - a datetime field (use for recurring events)
    • time_start - a text field

Listing events by date_start is simple when the site only has run-once events (using the 'date_start' field). But when repeated events enter the picture, it is necesssary to generate all occurrences for each repeated event ('dates.date_start') - and join these with the list of run-once events ('date_start'). I am unsure if that is possible?

PS: I am aware that Ryan created an Events fieldtype module, unfortunately the site needs more detail about each event than this module offers so it is easier to create a site-specific set of Event fields.

Share this post


Link to post
Share on other sites

Maybe it's easier to let Google do the heavy lifting and just display the results on your website...

Quote

There's no eye candy here, but the benefits of pulling from Google's services (like Calendar) aren't so much in the output of examples like this, but instead in the fact that their website is connected to a bigger ecosystem. An ecosystem the client can manage in various places and with various people, various devices and so on. A service like Calendar can also be subscribed to by other users and is generally a lot more broadly "connected" than an individual website would be. Being able to make the website part of that bigger network of activity is a real benefit to clients. And the fact that it's essentially free, while more capable and powerful than almost any paid option is definitely a mountain of icing on the cake.

https://processwire.com/blog/posts/composer-google-calendars-and-processwire

Share this post


Link to post
Share on other sites

I have had similar event-situations in the past and went different ways.

Solution 1:

I added a date_end (to keep your naming) field to my events and displayed an additional "from/ab (german: from)" to the event itself when listed somewhere - so no repeaters needed (in my case). It's almost like a date range for a single event. Works really well and can be found at: https://www.musikschule-neumuenster.de/termine/ 

Solution 2:

I created one main page for that event and used @psy's recurring events module to create follow-up pages/events I can show in my lists.

 

In your case I'd probably go with solution 2.

That way you can although create semantic JSON+LD markup for each day/event if wanted.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By AndZyk
      This is a website for the musical area of the protestant town church Pforzheim, Germany. Our agency designconcepts developed a website that provides informations about the choirs, ensembles and orchestras as well as dates for their rehearsals, services and concerts.
      The website was build with help of the framework UIkit.
      www.musik.stadtkirche-pforzheim.de
       
      Features:
      Events Download dates  
      Events

      The events for rehearsals, services and concerts were created in Microsoft Excel and then imported as pages from CSV. For better organization, events are cross-referenced with choirs, ensembles and orchestras. Services and concerts are displayed in a events list, but rehearsals are only displayed on the page of the choir, ensemble or orchestra, to make the events list more compact.
       
      Download dates

      It is possible to download every event date as ICS file, which will be generated on clicking the download button. You can then add this event easily to your calendar app and stay up-to-date.
       
      Modules used:
      Email Obfuscation (EMO) Front-End Page Editor Import Pages from CSV Markup Sitemap XML ProCache Tracy Debugger Upgrades Wire Mail SMTP  
      Regards, Andreas
       
    • By BrendonKoz
      I began writing this module from scratch, basing it off simple examples of modules, trying to learn the necessary methods required to create a fieldtype. I was WAY off, but learned a lot. Eventually I moved towards examining the FieldtypeEvents example from Ryan and, in many areas, copy/pasting and then adjusting the code (and then trying to determine what it all was doing) method by method, file by file (from his example to my module).
      I've gotten to the point where I was ready to test the code - I haven't fully fleshed out my visual interface, nor integrated any of the 3rd party API tools this will (can) take advantage of. I also haven't implemented any JS or CSS for the interface. Right now I'm just trying to get it to save and then display any of the data that has been entered into the form fields of a template from the admin. When I save the page, the field is reset to defaults and no feedback message (for the field) is shown at the top of the page upon reload. When using Tracy Debugger from within the processInput method (immediately attempting to debug the $input variable), Tracy caught no data to be shown.
      If anyone has some time to take a quick look and see what I might've done wrong I'd be super grateful. I've had no forward progress in about 3 days (and like many others was unable to get Xdebug breakpoints working in PHPStorm). 😞
      https://github.com/BrendonKoz/FieldtypeBooks
    • By Mats
      I’m building a simple ticket booking system for our events. I’m considering two different solutions:
      The first approach is creating one page per ticket and a reference to a booking page with the contact info. This should be faster when checking for ticket availability by using $pages->count().
      The other one is a one page per booking with an integer field holding the ticket quantity. Downside is having to use $pages->find() but only having to create one page per booking with the API. 
      My biggest concern is listing the events and the ticket availability for each event, loading all bookings.
      At the most one event has 300 bookings.
      Any ideas are welcome.  
    • By joshuag
      Introducing our newest [commercial] module:
      Recurme
      Processwire Recurring Dates Field & Custom Calendar Module.
      http://www.99lime.com/modules/recurme/
      One Field to Recur them ALL…
      A Recurring Dates InputField for your Processwire templates. The InputField you’ve been waiting for.
      Complex RRule date repeating in a simple and fast user interface.
      Use the super simple, & powerful API to output them into your templates.
      example:
      <? // easy to get recurring events $events = $recurme->find(); // events for this day $events = $recurme->day(); // events for this week $events = $recurme->week(); // events for this month $events = $recurme->month(); ?> <? // Loop through your events foreach($events as $event){ echo $event->title; echo $event->start_date; echo $event->rrule; echo $event->original->url; ... } ?> Unlimited Custom Calendars.
      Imagine you could create any calendar you wanted on your website. Use recurring events with the Recurme field, or use your own Processwire pages and date fields to render calendars… it’s up to you. Fully customizable. Make as many calendars as you like. Get events from anywhere. Recurme does all the hard date work for you.
      Unlimited Custom Admin Calendars too.
      Hope you like it  ,
       Joshua & Eduardo from 99Lime.
       





       
      ## [1.0.1] - 2017-05-29
      ### changed
      - Fixed $options[weekStartDay] offset in Calendar
      - Fixed ->renderCalendar() Blank Days
      - Fixed missing ->renderList() [renderMonth][xAfter]
      - Removed ->renderCalendar() <table> attributes border, border-spacing
      - Fixed ->renderCalendar() excluded dates
      - Fixed rrule-giu.js exclude dates
      - Fixed ->renderList missing space in attr ID
      (shout out to @Juergen for multiple suggestions & feedback).
    • By ---
      So I discovered in this topic (
      ) that I can cancel all hooks after my own hook. Now I want something like that.
       
      I want my hook which is called on page render to cancel all other events, also the after page render and the before page render methods, is this possible?
      This only need to be done when some conditions are met.
       
      /** method replaces original page::render method and is called with hook priority one */ method onPageRender (HookEvent $event) { if (my condition is true) { $this->cancelHooks = true; // to cancel all hooks to page::render // how to cancel after Page::render events // how to cancel before Page::render events } } Is this possible at all?
×
×
  • Create New...