Timeline views for collections and folders (using verite TimelineJS).
Project description
Introduction
This package integrates the Verite TimelineJS application into Plone, providing a beautiful, customizable timeline view for folders and collections.
It adds a view timeline-view for Folders, new-style Collections, and old-style Collections (ATTopic).
In addition, it adds a Dexterity behavior for setting timeline dates on content and a schema extender that applies to all Archetypes content (except ATEvent, for which the normal date fields are used).
If the content has a remoteUrl (i.e. an ATLink), that link will be used to generate the thumbnail for the page. Special handling is built in for Youtube, Twitter, Wikipedia and Flickr links, among others. Otherwise, the page url is used to generate the thumbnail.
Customizations
The default adapters for Archetypes and Dexterity content should handle most use cases. However, you may customize the timeline metadata for specific content types by registering adapters to the ITimelineContent and/or ITimelineSupplement interfaces.
For example if I wanted to change the asset url for my IFoo content type I would simply add the following to a grokked package:
from five import grok from collective.timelines.interfaces import ITimelineSupplement class FooTimelineSupplement(grok.Adapter): grok.name('foo') grok.context(IFoo) grok.provides(ITimelineSupplement) def update(self, data): data['asset']['media'] = self.context.my_url return data
There is an example of a timeline supplement provided in the map_support module, which uses metadata from Products.Maps enabled content to display a map in the timeline.
To override the date calculation to use a custom date, or to completely change the base data, you can override the ITimelineContent adapter:
from five import grok from DateTime import DateTime from collective.timelines.interfaces import ITimelineContent from collective.timelines.dexterity_content import TimeLineContent class FooTimelineContent(TimelineContent): grok.provides(ITimelineContent) grok.context(IFoo) def date(self): date = self.context.my_date return DateTime(date.year, date.month, date.day) def data(self): # Calculate custom dictionary for timeline date entry
There is an example of a custom ITimelineContent data provider in the at_content module, which handles ATEvent content by automatically using the start and end dates.
Credits
Alec Mitchell
Carlos de la Guardia
Jazkarta, Inc.
With support and funding from Dumbarton Oaks Research Library and Collection, Washington DC
Changelog
1.0 (2019-10-30)
Fix bug when field data is missing.
Documentation updates.
1.0b1 (2013-11-08)
Datetime formatting fixes.
Add collective.contentleadimage support.
Dexterity schema and view link fixes.
0.5 (2013-03-07)
Initial Release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file collective.timelines-1.0.tar.gz
.
File metadata
- Download URL: collective.timelines-1.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e57453687c2a91f47139ccadefb424cfd0e35b762cfff0f587930a4c479653a |
|
MD5 | d627ba4019f4d7fdc3708ee71551a11e |
|
BLAKE2b-256 | 2a9d68c3dd5e04f2bf0f940f527c0c84c7e2bb5b1f6ba6f13014514e583930b2 |