pb9
November 9, 2022, 9:13am
1
Hi everyone!
I am trying to add category tags to our product pages, via a Liquid block on the product page template.
I’ve used the following code:
{% for tag in product.tags %}
{{ tag }}
{% endfor %}
It works, the tags show up properly - now I would just like to style them with some CSS.
(Color them, give them some background & edging - actually, very similar to the label tags on this page here):
Can I do this directly in the liquid block via CSS? Or do I need to edit a theme or css file somewhere else?
(Ideally it would be just on product page in this use case, as that’s the only place we’re going to be displaying them)
Thank you!
Hello @pb9 ,
Please share your website URL
pb9
November 9, 2022, 9:42am
3
Hello - none of this is live on our site yet, we’re just tinkering on the backend to see if we want to add it live after we get it styled.
We’re using the Pipeline theme, if that’s what you’re after
You can share preview URL with us.
pb9
November 9, 2022, 10:16am
5
It doesn’t let me share preview without saving in editor, but we only really need help with the top right liquid block in the corner. How do we apply CSS there? (Or can we not?)
(You can see the ‘unfinished’ product tags - comedy, romance - are displaying properly, we just want to style those)
Litos
November 9, 2022, 1:52pm
6
Hi @pb9 ,
Please change all code:
{% for tag in product.tags %}
{{ tag }}
{% endfor %}
You can change the color code to your liking.
Hope it helps!
1 Like
pb9
November 9, 2022, 3:21pm
7
Exactly what we were looking for, thank you so much Litos!
1 Like