briceburg / silverstripe-flexichoice
SilverStripe field for providing arbitrary text input or selecting from YAML configurable presets.
Installs: 32
Dependents: 0
Suggesters: 1
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 3
Type:silverstripe-module
Requires
- silverstripe/framework: ~3.0
Suggests
- briceburg/silverstripe-flexilink: Link to SiteTree Pages, External URLs, YouTube Videos, &c. from a single, flexible SilverStripe field.
This package is not auto-updated.
Last update: 2024-12-17 17:24:13 UTC
README
SilverStripe field for providing arbitrary text input or selecting from YAML configurable presets.
Requirements
SilverStripe 3+
Screenshots
(the 'Link Text' field demonstrates a FlexiChoiceField
,
the 'Link' field is a silverstripe-flexilink field)
Usage
- Add
FlexiChoice
field types to yourDataObject
(s)
class BlockContentHeading extends DataObject { private static $db = array( 'Title' => 'Varchar', 'Content' => 'Text', 'Link' => 'FlexiLink', 'LinkText' => 'FlexiChoice', // <--- here );
Trigger the environment builder (/dev/build) after extending objects --
You will now see the FlexiChoiceField
appear in the CMS when editing your
object.
- Define presets in YAML Configuration
FlexiChoiceField: choices: - LEARN MORE - READ MORE - MORE - GET STARTED
You may of course subclass FlexiChoiceField
to provide multiple fields with
different choice selections.