Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue May 16, 2024 · 2 comments

Comments

@espenlg
Copy link

espenlg commented May 16, 2024

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
Copy link

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
Copy link
Author

espenlg commented May 21, 2024

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants