All things Shopify and commerce
As far as I know when we create a new tag we are able to define the tag name. Is there any way to define an extra information like tag description . Because we want to show on the banner the heading/description associated with select tag. How can we do that ?
Thanks
Solved! Go to the solution
This is an accepted solution.
Hi @lujbek
I hope you are doing well.
It will require some advance knowledge of liquid
You can do that by using metafields/metaobjects
Thanks!
This is an accepted solution.
Hi @lujbek
I hope you are doing well.
It will require some advance knowledge of liquid
You can do that by using metafields/metaobjects
Thanks!
It worked. Thanks for your advise
Any tips on how to add a metafield to a blog post tag? The Shopify admin panel doesn't provide an option for this.
Hi @ri2
You can use metaobject for this, you can use 2 fields
a. One for blog post tag --> it can act as an identifier
b. Actual metafield to use
so, you can search among metaobject entries by post tag and then use the matching metafield
Thanks!
That makes sense. Thanks for the reply!
Follow up for anyone who needs this:
{% for custom_tag in shop.metaobjects.custom_blog_post_tag.values %}
{%if custom_tag.name == current_tags.first %}
{{ custom_tag.short_description | metafield_tag }}
{{ custom_tag.description | metafield_tag }}
{% endif %}
{% endfor %}
This code will not return anything if a meta object is not found that matches the current tag. Since the blog home page itself (eg /blogs/blog/) doesn't have a tag assigned, it won't show anything on the blog home page, only on the pages for the tags (eg /blogs/blog/tagged/tag-name)
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024