Truncate Lexical Rich Text Pages Component

Hi team,

I’m really excited about the new pages infrastructure and rich text components to go with it.

I’m using the new LexicalRichText component but want to truncate the field value to show the first 500 characters on my help article cards. Is there a recommended way to do this?

Thank in advance!
Henry

Hi Henry,

Rich Text V2 fields stored in Yext Content are passed to downstream systems as a JSON object representing an abstract syntax tree that is then used by the LexicalRichText component to render the rich text.

Because it is not a string, we can’t truncate the content like we normally we would with a string field. My recommendation would be to store a summary of the rich text in a different single-line or multiline field and display that in the card.

Hope this helps,

Aaron