Metaobject text fileds with html support?

Topic summary

A user encountered limitations with Shopify’s metaobject rich text field, which doesn’t support HTML table insertion.

Solution provided:

  • Use a multi-line text field instead of rich text to store raw HTML
  • Navigate to metaobject definition and add a multi-line text field (e.g., “ingredients_table_html”)
  • Paste the complete HTML table code directly into this field
  • Render in theme using Liquid: {{ metaobject.ingredients_table_html | raw }}

Key technical note:

  • The | raw filter is essential to output actual HTML rather than escaped plain text
  • Rich text fields are designed for basic formatting (bold, italic, lists) and don’t provide granular HTML control for complex structures like tables

The workaround successfully enables HTML table support within metaobjects.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

Hey, maybe I am blind :grinning_face_with_smiling_eyes: But is there a metaobject with html support? I choose a rich text, but I cant there insert a table like this:

Thank you!

1 Like

Hello @PetrK

Solution: Use a multi_line_text_field (or custom field) to store HTML
1.Go to your metaobject definition.

2.Add a field:

. Type: Multi-line text (or Single-line if short HTML)

. Name: e.g., ingredients_table_html

3.Paste your full HTML table into that field:

<table>

  <tr>

    <th>

Amount

</th>
<th>

</th>

  </tr>

  <tr>

    <td>

MG

</td>
<td>

375 mg (100%*)

</td>

  </tr>

  <tr>

    <td>

Vitamin D3

</td>
<td>

10 ”g (200%)*

</td>

  </tr>

  <tr>

    <td colspan="2">

*text

</td>

  </tr>

</table>

4.In your theme code, render it like this:

liquid

{{ metaobject.ingredients_table_html | raw }}

Important Notes:
. | raw is necessary to output HTML instead of plain text.

. Avoid using rich_text if you want control over HTML tables — it’s more for styled content like bold/italic/lists.

Thank you :blush:

1 Like