SilverStripe field for providing arbitrary text input or selecting from YAML configurable presets.
SilverStripe field for providing arbitrary text input or selecting from YAML configurable presets.
SilverStripe 3+
(the 'Link Text' field demonstrates a FlexiChoiceField
,
the 'Link' field is a silverstripe-flexilink field)
FlexiChoice
field types to your DataObject
(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.
FlexiChoiceField:
choices:
- LEARN MORE
- READ MORE
- MORE
- GET STARTED
You may of course subclass FlexiChoiceField
to provide multiple fields with
different choice selections.
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