Create and manage timelines in an ordered, hierarchical manner.
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
API Fix pathing, .header-styling Dec 7, 2018
assets Fix pathing, .header-styling Dec 7, 2018
blueprints Initial release Sep 9, 2018
cli Print-styles, Markdown from Data-API Sep 20, 2018
data Initial release Sep 9, 2018
node_modules Responsive-styles Sep 20, 2018
templates Fix pathing, .header-styling Dec 7, 2018
twig
vendor WIP v1.1.0 Sep 18, 2018
.gitignore Fixed Composer Sep 9, 2018
CHANGELOG.md Fix pathing, .header-styling Dec 7, 2018
LICENSE Initial release Sep 9, 2018
README.md Template-partials, timeline-injection WIP, code quality Dec 4, 2018
Utilities.php Fix missing orderBy-options and sortLeaf-defaults Nov 30, 2018
blueprints.yaml Template-partials, timeline-injection WIP, code quality Dec 4, 2018
composer.json WIP v1.1.0 Sep 18, 2018
composer.lock WIP v1.1.0 Sep 18, 2018
languages.yaml Added blueprint option for linked_data Nov 30, 2018
package.json Responsive-styles Sep 20, 2018
timeline.php Template-partials, timeline-injection WIP, code quality Dec 4, 2018
timeline.yaml Fix LinkedData-assets and misaligned events CSS Nov 30, 2018

README.md

Timeline Plugin

The Timeline-plugin is for Grav CMS, and lets you create and manage timelines in an ordered, hierarchical manner. Timelines can be nested within each other, minutely customized on a page-level, and further customized with your own templates and styles. A demo is available, and demo content can be found in /pages.

Installation

Installing the Timeline-plugin can be done in one of two ways. The GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file.

Requirements

This plugin will only work with Grav v1.6 or higher, as it requires PHP v7.1 or higher. Dropping this requirement would mean devolving features, which the author is not inclined to do.

The intl-extension for PHP must be installed and enabled to use this plugin.

GPM Installation (Preferred)

The simplest way to install this plugin is via the Grav Package Manager (GPM) through your system's terminal (also called the command line). From the root of your Grav install type:

bin/gpm install timeline

This will install the Timeline-plugin into your /user/plugins directory within Grav. Its files can be found under /your/site/grav/user/plugins/timeline.

Manual Installation

To install this plugin, just download the zip version of this repository and unzip it under /your/site/grav/user/plugins. Then, rename the folder to timeline. You can find these files on GitHub or via GetGrav.org.

You should now have all the plugin files under

/your/site/grav/user/plugins/timeline

NOTE: This plugin is a modular component for Grav which requires Grav and the Error and Problems to operate.

Configuration

Before configuring this plugin, you should copy the user/plugins/timeline/timeline.yaml to user/config/plugins/timeline.yaml and only edit that copy.

Here is the default configuration and an explanation of available options:

enabled: true
language: en
order:
  by: date
  dir: asc
cache: native
truncate: 100

Settings and Usage

Variable Default Options Note
enabled true true or false Enables or disables the plugin.
language en string (2) Any two-letter (ISO-639-1) language code.
order:
by date date, title, or folder Orders pages according to date, title, or folder-name.
dir asc asc or desc Order pages ascending or descending.
cache native native, persist, transient, or disabled Where to store plugin's internal data.
truncate 100 int or boolean Limits the amount of words in each note, to an integer or boolean state for default (100).
linked_data true true or false Enables or disables Linked Data output.
inject_timeline null string Route to page to inject.
inject_period false true or false Inject page as timeline-period if true, only events if false.

Each timeline is structured with a Header (timeline.md, Timeline-template) and Events (timeline_event.md, Timeline Event-template). Headers are used as separators and can order their descendant Events, as well as contain normal fields such as title, subtitle, and content. Events also render a formatted, localized date (using date_format and locale), as well as an image. In addition, Events are cast as Linked Data with JSON-LD, wherein type, place, locality, and region are used.

Timelines can be mixed together from different locations in /user/pages by using the inject_timeline-field. Point it to a route (not path) where another timeline exists, and it will be added at the end of the current timeline. This can be done from any page that is a timeline, but not from an event. Use inject_period to designate that the page itself should be included, to demarcate a new period immediately following the timeline it was injected from.

Printing

Two modes of printing are supported: Pure TexT or Graphics.

By default, graphics are included, and the layout will typically emulate mobile-view. Events will not alternate between odd and even.

To print pure text, remove the print-class from <div class="print timeline-wrapper col-12 col-sm-10 col-sm-offset-1 col-md-8 offset-md-2"> in timeline.html.twig.

Development

Use a SCSS-compiler, like LibSass, eg. node-sass and compile assets/timeline.scss to assets/timeline.css in the plugin-folder. For example: node-sass --watch --source-map true assets/timeline.scss assets/timeline.css.