Custom API Looper Dynamic Content HTML rendering

I’ve hunted through the docs and I can’t find any reference to rendering HTML content in looper values, but I’m assuming it must be possible given the ability to render post content… am I missing a type property or is this not possible with dynamic content being called via the custom API looper? My API call returns a JSON array of objects that have a “message” value which is a string containing simple HTML.

Any pointer/assistance much appreciated.

Hi @ConceptFusion,

Thanks for reaching out.
It is possible to render the HTML content; it might be something else why the content in your case is not showing. Can you please provide the looper provider output JSON that you are trying to show?

Thanks

Hey @tristup

The message content is being referenced in the looper as follows: {{dc:looper:field key=“message”}}

Here’s an example JSON response:

    {
    "message": "Referees<br /><br />Can the 2023 refs please come to a quick hui at the start of morning tea in Room 20 on Friday. We need to discuss the launch of Lunchtime Sport. A roll will be taken.<br /><br />",
    "event_from_f": "31st January 2024",
    "event_to_f": "31st January 2024",
    "teacher": "Liz Moka - Mangaroa Leader"
  },
  {
    "message": "<span>RAD Is starting Week 3 This term.  There will be a full training day for new year 7s &amp; some Year 8 \u0100konga.  Come see Mr. Webb in the STEAM room or email him if you are interested. </span><a href=mailto:caleb.webb@maidstone.school.nz target=_blank>caleb.webb@maidstone.school.nz</a>",
    "event_from_f": "29th January 2024",
    "event_to_f": "29th January 2024",
    "teacher": "Caleb Webb - STEAM"
  }

You should just be able to use the HTML in a text Element. You’re referring the External API right?

You are looping through the correct thing right? Try this to make sure you are. You should see the fields come through. Why don’t you send us over the site if none of this helps.

<pre>
{{dc:looper:item type="json"}}
</pre>

If you are not looping the right thing, this might work.
{{dc:looper:field key="0.message"}}

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.