Streaming live at 10am (PST)

Give id to an element within rich text in CMS


#1

Hi all,

Is there a way to give an id to an element (such as headline) within a rich text field in your CMS? I'd like to create an in-page link to a specific section of my rich text that comes from the CMS. It looks to be unsupported - anyone knows a workaround?

Thanks,
Greg


#2

Hi @greg.os
If Rich text element has a class every, element inside it can be "pointed" separately and has ID field on the settings panel. I never really tried to use with page navigation but ID can be applied, that is for sure.

Cheers,
Anna


#3

Be aware that you should only have one unique ID attribute per page; otherwise, it will cause navigation problems.
For example, if you name an image inside your class-named rich text block with an ID = "image", you shouldn't repeat that same-class text block again on the page because it will result in another image with an ID = "image."


#4

You are right you can assign an id to every element within a rich text block when the content of the rich text block is non dynamic i.e. not bound to a CMS field. However once the content comes from CMS, it looks like i can only give an id to the whole rich text block, but not the individual elements inside it.


#5

Hmmm... yeah, you are right :confused: Well, I don't know if this workaround will fit your idea.

I think the only way is to set separate parts of content as different dynamic fields inside the item. For example: "Intro", "Main article" and "Conclusions". Then you can set them as several different Rich text elements with ID to each part. BTW, menu for Dynamic templates will show absolutely identical, so you have not so big shoice.

Regards.


#6

Thanks for the suggestion! Yep it seems like the only way around this. I wonder if webflow might support this one day?


#7