Add fragment selection for element-type links #38
Replies: 2 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
-
Support for something like this would be amazing. I frequently need to provide functionality to link directly to a specific Matrix block on a page (where the page has corresponding anchor links for individual blocks). I'm currently heading down a path similar to what @MangoMarcus is doing above, and then will append the anchor to the URL manually in my templates. Being able to select from Matrix blocks included on a specific page (and somehow have that auto-converted into a URL with anchor) would be, for me, the dream scenario. I'd imagine providing full support for something like this might be messy and difficult. A start might be adding a special "Anchor Link" link type that adds a plain text field for the anchor (similar to above), but with the bonus of Hyper handling adding that anchor to the URL output for you. Even that bit of automation would be nifty and help keep the template / partial code a little cleaner. |
Beta Was this translation helpful? Give feedback.
-
There are times where you might want to link to a fragment on a page - for example linking to an ID on a page.
You might have:
<h2 id="my-heading">Example Heading</h2>
and you'd want to provide a nice means to link to that. This would only be possible for element-type links, and not 100% sure on the UI for this, combining with element select fields. But you would select the element you want, an Ajax request to query the front-end template for that element, parse just items with an ID attribute, and list those for picking.Beta Was this translation helpful? Give feedback.
All reactions