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
Umbraco v8 RTE - Auto assign ID attributes to headings #9317
Comments
|
Do this. |
|
I'm not discouraging this, only wanted to point out that the RTE data-type does have an "Anchor" button for the toolbar. |
|
It does, but it's a manual process of having to link all the headings. Also, I don't really find the anchor UI that friendly and often needs explaining to editors. . If we can save clicks and just implement something that works automatically, I think that could be a better UX. |
|
I saw an example here using HTML Agility pack to auto generate an anchor at the heading. |
|
For this exact reason when using any of the block based editor approaches I have the header as an item outside of the RTE to do this. It does also have the benefit here of being able to loop through the headings to auto generate a contents list which saves a lot of time. Might be interesting if that could be made into a helper alongside this. |
|
I'm a bit hesitant about this one as people do enjoy that we're outputting the exact HTML that's there and nothing more. People might not appreciate us suddenly adding "bloat" to the output. What do you think about adding your own PropertyValueConverter to do this instead? Alternatively there's also not "text fragment links" at least in Chrome (https://en.wikipedia.org/wiki/Cat#:~:text=Most%20breeds%20of%20cat%20have%20a%20noted%20fondness%20for%20sitting%20in%20high%20places) which could be helpful (I know it's not a standard, just throwing it out there). We'll have a chat about this and get back to you. |
|
Hiya @mattbrailsford, Just wanted to let you know that we noticed that this issue got a bit stale and might not be relevant any more. We will close this issue for now but we're happy to open it up again if you think it's still relevant (for example: it's a feature request that's not yet implemented, or it's a bug that's not yet been fixed). To open it this issue up again, you can write For example:
This will reopen the issue in the next few hours. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
When editing RTE content, if rendering header tags (h1, h2, h3 etc) it's quite common to want to be able to anchor to these. It would be great within the RTE value converter, how we have pre-processors for things like internal links / media, if we could also parse headings and auto assign them an ID attribute, probably with the value being a URL safe alias of it's contents (checking that there aren't duplicates within the RTE content).
The text was updated successfully, but these errors were encountered: