Adds a question mark next to the label of another field that expands to show text when clicked. Can be used to add extra information or instructions without taking up space all the time.
- Nathan Cox (nathan@flyingmonkey.co.nz)
- SilverStripe 2.4+
- Place the files in a directory called helpfield in the root of your SilverStripe installation
- Visit yoursite.com/dev/build to rebuild the database
HelpField takes two parameters:
-
The name of the field you want to add help text to (eg, "MenuTitle" or "Content")
-
The help text itself. Should be a string of text/HTML
$fields->addFieldToTab('Root.Content.Main', new HelpField('Content', ' You can use the following short tags in the content:
[video] - inserts the video uploaded in the Media tab into the content
[toaster] - inserts a formatted button that, when clicked, makes toast '));