Shopify themes, liquid, logos, and UX
I can find code for every other section. Why don't I see an entry for Featured Collection?
I see this in collection.liquid:
{% schema %}
{
"name": {
"de": "Featured Kategorie",
"en": "Featured collection",
"es": "Colección destacada",
"fr": "Collection vedette",
"it": "Collezione in evidenza",
"ja": "特集コレクション",
"pt-BR": "Coleção em destaque"
},
but I don't see "featured collection" in theme.scss.liquid.
Clearly missing something, probably obvious.
Why do I want this? If my Featured Collection is empty, I want nothing to appear on the page where the collection should be. Right now it shows all the default empty collection stuff. If I can insert a condition like {% unless collection.all_products_count > 0 %} at the start I can keep anything from being rendered, omitting everything. Yes?
Thanks
Ed K
Hi @edk
The file you're looking for is: collection-list.liquid
Let me know if that helps!
Thanks for the answer.
OK, I can see where that will format and populate the Featured Products section. But when I bracket the original code in an if:
{% if collection.all_products_count > 0 %}
<entire contents of collection-list.liquid>
{% endif %}
I still get the page rendered with an empty collection:
so, there is nothing being populated in the Featured Products section, but the section itself is still getting inserted and displayed with an empty collection. I need to prevent the section from being inserted at all.
If I inspect the page (https://traditionalartstodaystore.org/) with Chrome, I see that the Featured Collection section begins here:
<div id="shopify-section-1596673354694" class="shopify-section index-section" == 0$
Is it the case that I need to somehow suppress or bypass whatever it is that places that on the page? Where can I do that?
I guess a better way to phrase this is: the content of the Featured Collection section is dynamic, but the existence of the Featured Collection section on the front page is static.
Can the front page rendering be dynamic? Can I change the makeup of the front page based on a variable? Because I think that's what I need.
Did you find a solution to your question?
I would like to modify collection content and your question is exactly what i need to know.
yes - start the code with
{% if collection.all_products_count > 0 %}
and end with
{% endif %}
I believe this keeps any of the rendering code from executing, and the main engine just moves on.
Let me know if this works for you.
Ed K
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024