SilverStripe\ElementalBlocks\Form\BlockLinkField
Synopsis
class BlockLinkField
extends FormField
{
- // members
- protected ArrayData $parsedValue;
- protected bool $showLinkText = true;
- // methods
- public void Type()
- public void setValue()
- public ArrayData getParsedValue()
- public bool getLinkDefined()
- public SiteTree|null getLinkPage()
- public string getLinkRelativeUrl()
- public string getLinkText()
- public string getLinkDescription()
- public bool getLinkTargetBlank()
- public $this setShowLinkText()
- public bool getShowLinkText()
Hierarchy
Extends
- SilverStripe\Forms\FormField
Members
protected
- $parsedValue
—
SilverStripe\View\ArrayData
Cache for parsed value - $showLinkText
—
SilverStripe\ElementalBlocks\Form\bool
Whether to show the "link text" field
Methods
public
- Type()
- getLinkDefined() — Get whether a {@link SiteTree} link has been defined on this link field
- getLinkDescription() — Get the link "description", used for titles or alt text
- getLinkPage() — Get the linked {@link SiteTree} object, if available
- getLinkRelativeUrl() — Get the relative URL for the linked {@link SiteTree} object, with a leading slash
- getLinkTargetBlank() — Get whether to open the link in a new window
- getLinkText() — Get the link text/title
- getParsedValue() — Return a parsed {@link ArrayData} object from the contents of the JSON value. Will be cached for future use, and the cache will be reset via setValue each time.
- getShowLinkText() — Get whether to display the link text field
- setShowLinkText() — Set whether to display the link text field
- setValue() — Reset the cached parsed value when setting a new value