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

Umbraco v8 RTE - Auto assign ID attributes to headings #9317

Closed
mattbrailsford opened this issue Oct 30, 2020 · 7 comments
Closed

Umbraco v8 RTE - Auto assign ID attributes to headings #9317

mattbrailsford opened this issue Oct 30, 2020 · 7 comments
Labels
state/needs-investigation This requires input from HQ or community to proceed status/stale Marked as stale due to inactivity type/feature

Comments

@mattbrailsford
Copy link
Contributor

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

@emmaburstow
Copy link
Contributor

Do this.

@leekelleher
Copy link
Member

I'm not discouraging this, only wanted to point out that the RTE data-type does have an "Anchor" button for the toolbar.

@mattbrailsford
Copy link
Contributor Author

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.

@bjarnef
Copy link
Contributor

bjarnef commented Oct 31, 2020

I saw an example here using HTML Agility pack to auto generate an anchor at the heading.
https://swimburger.net/blog/dotnet/auto-generate-heading-anchors-using-html-agilitypack-dom-manipulation

@chudders22
Copy link

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.

@nul800sebastiaan
Copy link
Member

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.

@nul800sebastiaan nul800sebastiaan added state/needs-investigation This requires input from HQ or community to proceed type/feature labels Nov 3, 2020
@umbrabot
Copy link

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 @umbrabot still relevant in a new comment as the first line. It would be super helpful for us if on the next line you could let us know why you think it's still relevant.

For example:

@umbrabot still relevant
This bug can still be reproduced in version x.y.z

This will reopen the issue in the next few hours.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@umbrabot umbrabot added the status/stale Marked as stale due to inactivity label Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state/needs-investigation This requires input from HQ or community to proceed status/stale Marked as stale due to inactivity type/feature
Projects
None yet
Development

No branches or pull requests

7 participants