A SilverStripe module that allows developers to define a static list of global html anchors - #nav, #content, etc - allowing them to be used for constructing links and etc by CMS users.
A SilverStripe module that allows developers to define a static list of global html anchors - #nav, #content, etc - allowing them to be used for constructing links and etc by CMS users.
Intended to work inconjunction with modules that allow users to build links, or extending the create link functions in WYSIWYG editor, making global anchors available for link construction rather than only anchors within that content area.
SilverStripe 4
composer require fromholdio/silverstripe-globalanchors
No anchors are setup by default - to complete the install, you need to setup your anchors config:
Fromholdio\GlobalAnchors\GlobalAnchors:
anchors:
nav: 'Main Navigation'
content: 'Page Content'
footer: 'Footer'
Documentation will be forthcoming, but also, it's just one class and pretty lean. Check the class itself to see all options at the moment.
Key uses are below:
DropdownField::create(
'GlobalAnchorKey',
'Global Anchor',
GlobalAnchors::get_anchors()
);
$key = $this->GlobalAnchorKey;
$anchorTitle = GlobalAnchors::get_anchor_title($key);
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