$pages
$pages : object
Events Plugin Events Class
The Events Class processes event:
frontmatter and adds virtual Event pages
to the Grav page stack depending on frequency and repeat rules. Each
virtual page is assigned a new route using a static & unique 6 character
token based off the existing page id and date.
PHP version 5.6+
all() : object
Process Event Pages
This is where the Events plugin processes events into new dynamic pages.
There are 3 processing steps for updating $this->pages
before returning
it for use in the main plugin Events class.
This processes all Grav pages for event:
frontmatter and runs appropriate
filters for adding the page to @taxonomy.type: event
.
In this step, we process the page for the horizontal structure of events.
This processes events with event: repeat
frontmatter duplicating pages
and updating dates based on MTWRFSU
params.
The final processing step looks at pages with event: freq
frontmatter.
This clones the event vertically on a calender using daily, weekly, monthly, yearly
params.
Grav Pages List
preprocessEventPages(object $collection) : object
STEP 1: Preprocess Event Pages
Preprocess the front matter for processing down the line
this adds carbon _event:
frontmatter data for processing repeating
dates and etc.
object | $collection | Grav Collection |
$events Grav Collection
processReoccuringEvents(object $collection) : object
STEP 3: Process Reoccuring Events
Search for event: freq:
frontmatter and add pages vertically down
the calendar to the collection. This processor will also look for
event: until:
frontmatter for determining when to stop processing the
reoccuring event. If this front matter doesn't exist, then the plugin will
look for a value set in the plugin config (+6 months) and process
reoccuring event out to this date. If you need the event to reoccur further
than this default then you must set an until date.
object | $collection | Grav Collection |
Grav Collection
clonePage(object $page, array $dates, string $rule = null) : object
Clone an Event Page
This function clones a Grav Page and adds it as a virtual page to
$this->pages
. It also adds the page to $this->taxonomy
so that we can
query pages in templates and collection headers using @taxonomy.event
.
This will not create a physical page that is added to the filesystem.
Adding a new page to the system happens by adding the new dates to the
event:
frontmatter, updating the $page->date
, and adding a new and
unique $page->path
and $page->route
.
object | $page | Grav Page |
array | $dates | Carbon Dates |
string | $rule | Rule for repeating events |
Grav Page