What's your biggest current challenge? Have your say in Community Polls along the right column.

show metafield with html and a tag (link) on product page

show metafield with html and a tag (link) on product page

yoonlaser
Shopify Partner
35 0 7

Hello,

How can I show a metafield with HTML tags and a link in it?
The orange part should be link to another product.
The metafield is from Wordpress short description so the value for the metafield is exactly like the one in the blue box.
I wanted to use 'rich text' type when I add definition for the metafield, but the 'rich text' type is not activated, so I couldn't use it. Is it because I use a free theme?
If the rich text is not the only way, how can I show the link?

screentemp.png

Reply 1 (1)

PaulNewton
Shopify Partner
7481 660 1570

Hello @yoonlaser You'd just use a multiline metafield type, put in your content then output it either by coding it into the theme, using a theme setting block that can use it as a dynamic source.

Or use a custom-liquid block to output it using liquid i.e. {{ product.metafields.status.replacement_html.value }} or use a url metafield type {{ product.metafields.status.replacement_url.value }} .

Note the metafield namespace "status" and keys like "replacement_html" are arbitrary name them what you want for organization.

 

If you need this customization setup then contact me by mail for services.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Contact info in signature.

 

Good Hunting.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org