A decision tree is a succession of questions which depends on each others answers and displays a result accordingly. This module provides an easy way to build such tree and to add it to a page as an element.
$ composer require dnadesign/silverstripe-elemental-decisiontree
- SilverStripe 6.x
- (dnadesign/silvertsripe-elemental)[https://github.com/dnadesign/silverstripe-elemental]
The module automatically loads its JS and CSS only on pages that contain a decision tree element. This behaviour can be customised via YML config.
| Option | Default | Description |
|---|---|---|
javascript |
'dnadesign/silverstripe-elemental-decisiontree:javascript/decision-tree.src.js' |
Path to the JS file to load. Set to empty string to disable. |
css |
'dnadesign/silverstripe-elemental-decisiontree:css/decisiontree.css' |
Path to a CSS file to load. Set to empty string to disable. |
auto_detect |
true |
When enabled, checks if the current page has a decision tree element before loading assets. Set to false to load assets on all pages. |
Use your own JS instead of the module's default:
SilverStripe\Control\Controller:
javascript: 'app/javascript/my-decision-tree.js'Use your own CSS instead of the inline focus styles:
SilverStripe\Control\Controller:
css: 'app/css/my-decision-tree.css'Disable all asset loading:
SilverStripe\Control\Controller:
javascript: ''
css: ''Load assets on all pages (skip automatic element detection):
SilverStripe\Control\Controller:
auto_detect: false
