Open wernerkrauss opened 5 years ago
Related issue: https://github.com/silverstripe/silverstripe-cms/issues/2440
@wernerkrauss I have been thinking about this and my ideal solution would be to add a field to Sitetree that stores a serialized list of anchor. These anchors can then be registered by some sort of method i.e addExtraAnchor('nameHere')
on SiteTree. Then with a getter i.e getAnchors()
I could get a list of anchors and put them in a dropdown. This means that anchors from modules such as Elemental could be listed. Sitetree could use beforeWrite to check the content field and register anchors found in the field.
There is already a ticket raised in Elemental to get it to work with the existing anchor link functionality in SilverStripe - I recommend against making a workaround for modules which don't use the existing anchor extension point.
Anchors on a page can already be accessed using getAnchorsOnPage
which already has an extension point updateAnchorsOnPage
.
The issue @GuySartorelli talked about is now solved and ready to use ;) https://github.com/silverstripe/silverstripe-elemental/issues/186
When linking to a page in the CMS it would be handy to choose from the existing anchors in a dropdown.
I think I've seen this in the TinyMCE link widged.