saltedherring / silverstripe-shortlist
Shortlist module for SilverStripe CMS
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 1
Open Issues: 0
Type:silverstripe-module
Requires
- silverstripe/cms: ~3.3
- silverstripe/framework: ~3.3
This package is auto-updated.
Last update: 2022-02-01 12:57:08 UTC
README
Session based shortlist module for SilverStripe
This module allows for front end users to create shortlists of pages or dataobjects (which must have associated controllers & Links) which exist within the site. The shortlist is stored against the users' session (so adding/removing items only occurs during the session), but a unique URL for the particular shortlist may be shared.
Install
The module can be installed via composer:
composer require saltedherring/silverstripe-shortlist
Afterwards run a dev/build
Configuration Options
_config/_config.yml:
--- Name: shortlist After: 'framework/*','cms/*' --- ShortList: URLSegment: '/shortlist/' PaginationCount: 12
The base URL segment can be modified here, as can the pagination count (for the page that displays the actual list of items).
- Ensure that URL Segment can dynamically generate the route.
ShortList Object requirements
For an object to be able to be added to the shortlist it must:
- Provide a
Link
function - Extend
ShortListExtension
Front-end
The shortlist may be added to any template by including the supplied ShortListLinks
ss include:
<% include ShortListLinks %>
This will provide a mechanism to allow objects to be added & removed from the shortlist.
The other templates provided are:
-
templates/Layout/ShortList.ss (provides the template for the actual shortlist, including pagination controls)
-
templates/Layout/ShortList_empty.ss (for displaying empty shortlist messages)
-
Supply AJAX example use of pagination & add/remove links.
TO DO
- Ensure that URL Segment can dynamically generate the route.
- Supply AJAX example use of pagination & add/remove links.
Coding Standards
The code has been written to PSR1.