Shopify themes, liquid, logos, and UX
Hi,
On my productpage i added a field with collage images. However sometimes you don't have enough images to use to fill this section. How can i hide this field automatically when in the backend images are not filled (collage is filled by metafields)?
page with images
page when there are not enough images
Thanks! R.
Solved! Go to the solution
This is an accepted solution.
Hi @TOC-MR,
Please go to collage.liquid file and add code:
{% if product.metafields.custom.name_01.value != blank and product.metafields.custom.name_02.value != blank and product.metafields.custom.name_03.value != blank
%}
{% endif %}
This is an accepted solution.
Hi @TOC-MR,
Please go to video.liquid file and add code:
{% if product.metafields.custom.video.value != blank %}
{% endif %}
Hi @TOC-MR,
You can add conditions to it, ex:
{% if product.metafields.custom.image.value != blank %}
{% endif %}
you can try with name of metafields, it will work fine
Hi @TOC-MR,
It is not CSS code, it is changed directly in Liquid code.
If you have no experience with code, I can help you add it.
This is an accepted solution.
Hi @TOC-MR,
Please go to collage.liquid file and add code:
{% if product.metafields.custom.name_01.value != blank and product.metafields.custom.name_02.value != blank and product.metafields.custom.name_03.value != blank
%}
{% endif %}
Hi @namphan Thanks! This is working for the collage section, however the video section is still visible while metafield is empty and no youtube url is linked. I've tried to copy/adjust the code, however video section still visible. So i guess i am doing something wrong 🙂
This is an accepted solution.
Hi @TOC-MR,
Please go to video.liquid file and add code:
{% if product.metafields.custom.video.value != blank %}
{% endif %}
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