Replace strings with dynamic content in rich text

Hi guys,

I have a very specific problem to solve. We fetch blog page data from an REST API and present it using a rich text field, as the returned blog page is using markdown syntax.

But inside the blog page text there is strings that we want to replace with dynamic content.
An example, the blog page could say:

Read more of this on the following post:
post:2r1ly-p8x

Here we want to take the post id 2r1ly-p8x and do a call to a REST API, fetch the data and replace “post:2r1ly-p8x” with an component that present this post.

Any idea how to solve this?

1 Like

For anyone finding this later on, the solution was to create a formula that split the page text into an array of different types (markdown, post, etc, etc).
Then use a repeatable list to show the different parts using conditional rendering.

It makes it possible to mix in different types of elements/components in the blog page.