mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #8510 from open-sausages/pulls/4/remove-legacy-article
DOC Remove buggy example form the _Show Help Text on CMS Form Fields_
This commit is contained in:
commit
1ac8665aa9
@ -17,26 +17,7 @@ TextField::create('MyText', 'My Text Label')
|
|||||||
->setDescription('More <strong>detailed</strong> help');
|
->setDescription('More <strong>detailed</strong> help');
|
||||||
```
|
```
|
||||||
|
|
||||||
To show the help text as a tooltip instead of inline,
|
Sometimes a field requires a longer description to provide the user with context. Another option you have available is making the field's description togglable. This keeps
|
||||||
add a `.cms-description-tooltip` class.
|
|
||||||
|
|
||||||
|
|
||||||
```php
|
|
||||||
TextField::create('MyText', 'My Text Label')
|
|
||||||
->setDescription('More <strong>detailed</strong> help')
|
|
||||||
->addExtraClass('cms-description-tooltip');
|
|
||||||
```
|
|
||||||
|
|
||||||
Tooltips are only supported
|
|
||||||
for native, focusable input elements, which excludes
|
|
||||||
more complex fields like `GridField`
|
|
||||||
or `DropdownField` with the chosen.js behaviour applied.
|
|
||||||
|
|
||||||
Sometimes a field requires a longer description to provied the user with context.
|
|
||||||
Tooltips can be unwieldy when dealing with large blocks of text, especially if
|
|
||||||
you're including interactive elements like links.
|
|
||||||
|
|
||||||
Another option you have available is making the field's description togglable. This keeps
|
|
||||||
the UI tidy by hiding the description until the user requests more information
|
the UI tidy by hiding the description until the user requests more information
|
||||||
by clicking the 'info' icon displayed alongside the field.
|
by clicking the 'info' icon displayed alongside the field.
|
||||||
|
|
||||||
@ -47,16 +28,5 @@ TextField::create('MyText', 'My Text Label')
|
|||||||
->addExtraClass('cms-description-toggle');
|
->addExtraClass('cms-description-toggle');
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to provide a custom icon for toggling the description, you can do that
|
|
||||||
by setting an additional `RightTitle`.
|
|
||||||
|
|
||||||
|
|
||||||
```php
|
|
||||||
TextField::create('MyText', 'My Text Label')
|
|
||||||
->setDescription('More <strong>detailed</strong> help')
|
|
||||||
->addExtraClass('cms-description-toggle')
|
|
||||||
->setRightTitle('<a class="cms-description-trigger">My custom icon</a>');
|
|
||||||
```
|
|
||||||
|
|
||||||
Note: For more advanced help text we recommend using
|
Note: For more advanced help text we recommend using
|
||||||
[Custom form field templates](/developer_guides/forms/form_templates);
|
[Custom form field templates](/developer_guides/forms/form_templates);
|
||||||
|
Loading…
Reference in New Issue
Block a user