migcontrol / django-migcontrol

A Wagtail-based Django website for Migration Control
GNU General Public License v3.0
0 stars 5 forks source link

How do anchor links work? #204

Open shavek opened 1 year ago

shavek commented 1 year ago

Hi Balder! We wanted to implement anchor links more because in theory it sounds like a great enhancement for user experience. However, I do not understand how to make them work. Do you know? If I add a anchor link like #whoprofits, how to I link it to another part on the page with the same link? How can I choose which is directed to which?

benjaoming commented 1 year ago

I was just looking at the built-in feature. I'll have a look at enabling this soon.

Note to self: https://pypi.org/project/wagtail-draftail-anchors/

shavek commented 1 year ago

Thank you :)

benjaoming commented 1 year ago

I looked into this and didn't find an obvious way to use anchor link for other pages. The best method currently will be to copy the link from the browser's address bar and create the link as an "external" link.

The draw-back is that this doesn't automatically update itself. Which is also why Wagtail devs have a hard time figuring out a good solution :/

benjaoming commented 1 year ago

It seems like the current approach is to use the extension https://pypi.org/project/wagtail-draftail-anchors/ in order to at least be able to have a fixed anchor link. I'm not sure if that works with our TOC yet.