Hi,
When I import html from csv to rich text cms field the tag attributes are removed, like id or anything elese.
Do you know how to keep any attributes to make different, unique H2 tags for example?
Thank you.
Hi,
When I import html from csv to rich text cms field the tag attributes are removed, like id or anything elese.
Do you know how to keep any attributes to make different, unique H2 tags for example?
Thank you.
I recall the last time I needed a workaround to the sanitization process in Webflow I used data-*
Attributes: Since data-*
attributes are preserved, you can store unique identifiers or other custom data within them. I have not checked in a while so see if it works on an import test. Let me know if this solves your issue.
@MiklosMatyas Webflow’s CMS Rich Text field automatically strips all HTML tag attributes (like id
, class
, style
, data-*
, etc.) during CSV import or manual input for security and consistency reasons. So even if you add <h2 id="custom-id">Title</h2>
in your CSV, Webflow will strip out id="custom-id"
and leave you with just <h2>Title</h2>
.
Yes, I already tried data-* attribute, thanks @webdev
So, if no attribute is preserved, then how to target table of content links of a long blog post?
Try using a Rich Text field type with this approach..
<div data-rt-embed-type="html">
<h2 id="custom-id">Custom Heading</h2>
</div>
Wrapping your code where the h2 to in this case is what you want to remain intact.
Thank you. Eventually, I applied a custom javascript solution to match the TOC links to the H2 titles.