$now
$now : object
Current Carbon DateTime
Grav Events
The Events Plugin provides Event Listings and Calendars for your Grav
powered website. This plugin searches each page for event:
frontmatter
and then sets a custom taxonomy named type to event. It also sets
a repeating and frequency taxonomy to build more intricate collections.
The event_repeat
taxonomy will take a string in the format MTWRFSU
and
the event_freq
taxonomy will take daily, weekly, monthly, or yearly
.
These taxonomies are automatically added and processed by the plugin.
Below is a sample of what an event:
front matter section would look like in
a Grav page. Note: You can used the event template and yaml included in the
plugin for use in the admin plugin or add event:
frontmatter to any page of
your choice. This plugin is smart enough to add any page to @taxonomy.type
as an event so you can build collections off of pages taxonomized with the
event taxonomy type.
event:
start: 01/01/2015 6:00pm
end: 01/01/2015 7:00pm
repeat: MTWRFSU
freq: weekly
until: 01/01/2020
location: Raleigh, NC
coordinates: 35.7795897, -78.6381787
If you use the Admin pluin, the events plugin will automatically geo-decode the location field to a set of coordinates so that you don't have too.
PHP version 5.6+
onPluginsInitialized() : void
Initialize plugin configuration
Determine if the plugin should run and set the custom taxonomies to store event information in. We also initialize the Events and Calendar class that this plugin utilizes and then we start intercepting Grav hooks to build our events list and insert any vars we need into the system.
onPagesInitialized() : void
Add repeating and reoccuring events as Grav pages
Repeating Events: events the tile horizontally in a week MTWRFSU
Reoccuring Events: events that tile vertically through daily, weekly, monthly, yearly
The Events/Events class searches for pages with event:
frontmatter and
processes these into new Grav pages as needed. This is a dynamic operation
and does not add new physical pages to the filesystem.