statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
30 stars 1 forks source link

Link to items on a page (Automatic anchors on all items in an entry AND the option of linking to them) #1167

Open espenlg opened 1 month ago

espenlg commented 1 month ago

Quite often we need to link to a certain part of the page, and we usually create pages using replicators with blocks. To achieve this we have to add a text-field to all blocks called "ID" or "Anchor" and then the client needs to remember this and add # to an URL link somewhere else.

How nice would it be if the Link fieldtype not only could select an en entry, but also a specific item on that entry. In a perfect world (or by using an antlers tag) we could add this ID to the item, and the client could simply select entry and item when creating a link. The items would need to be recursive so all items also within replicators would be available for selection.

So instead of this: Screenshot 2024-05-16 at 14 20 51

Something like this: Screenshot 2024-05-16 at 14 37 56

j3ll3yfi5h commented 1 month ago

There are some solutions or helpers available by using addons, but I'd prefer also some kind of native feature... Or at least a combined native link field where you can select an entry and append a manual anchor to it.

https://statamic.com/addons/jacksleight/focal-link https://statamic.com/addons/visuellverstehen/anchor-navigation

espenlg commented 1 month ago

I was not aware of the Focal Link addon. It does the trick for now. I do however agree it would have been nice to have as a native feature :)