Metaobject text fileds with html support?

Solved

Metaobject text fileds with html support?

PetrK
Visitor
1 0 1

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

 

PetrK_0-1745412746201.png

 

 

Thank you! 

Accepted Solution (1)

goldi07
Navigator
360 38 69

This is an accepted solution.

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 😊

Was I helpful?

Buy me a coffee


APPS BY US :

Professional Customer Accounts APP


Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -Goldi184507@gmail.com - Skype: live:.cid.819bad8ddb52736c -Whatsapp: +919317950519
Checkout Some Free Sections Here

View solution in original post

Reply 1 (1)

goldi07
Navigator
360 38 69

This is an accepted solution.

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 😊

Was I helpful?

Buy me a coffee


APPS BY US :

Professional Customer Accounts APP


Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -Goldi184507@gmail.com - Skype: live:.cid.819bad8ddb52736c -Whatsapp: +919317950519
Checkout Some Free Sections Here