Lead visitors to content with a succession of questions and answers that suggest content tagged by taxonomy terms
This module enables CMS users to create a succession of questions and answers, which then suggests content to visitors using tags (taxonomy), acting as a pathfinder to pages on the site.
See the "require" section of composer.json
Relies on silverstripe/silverstripe-taxonomy
composer require codecraft/silverstripe-pathfinder
Pathfinder uses a ProgressStore
to dynamically track the progress of a user. This is how the Pathfinder knows which path the user is on, based on their precession of answers.
The default ProgressStore is the SessionProgressStore
, and stores progress in the user's PHP session.
To change the session store, update the ProgressStore
injector configuration, to assign the class
of the progress store you need:
SilverStripe\Core\Injector\Injector:
CodeCraft\Pathfinder\Model\Store\ProgressStore:
class: CodeCraft\Pathfinder\Model\Store\SessionProgressStore
CodeCraft\Pathfinder\Model\Store\SessionProgressStore
- (Default) Stores progress in the PHP session. Expires when the user's session expiresCodeCraft\Pathfinder\Model\Store\RequestVarProgressStore
- Stores progress in an encoded URL request variable. Expires when the URL request variable is discarded.CodeCraft\Pathfinder\Model\Store\LocalStorageProgressStore
- Stores progress in Local storage. Expires when local storage is cleared.A custom progress store can be created by subclassing CodeCraft\Pathfinder\Model\Store\ProgressStore
and modifying the Injector
configuration.
Example subclass:
<?php
use CodeCraft\Pathfinder\Model\Store\ProgressStore;
/**
* My custom progress store
*/
class MyProgressStore extends ProgressStore {}
Example Injector
configuration:
SilverStripe\Core\Injector\Injector:
CodeCraft\Pathfinder\Model\Store\ProgressStore:
class: MyProgressStore
Main differences:
This library follows Semver. According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.
All methods, with public visibility, are part of the public API. All other methods are not part of the public API. Where possible, we'll try to keep protected methods backwards-compatible in minor/patch versions, but if you're overriding methods then please test your work before upgrading.
Please create an issue for any bugs you've found, or features you're missing.
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem