Debut: where is the code for the Featured Collection section?

edk
Excursionist
27 2 18

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

Replies 5 (5)

JHKCreate
Shopify Expert
3571 639 916

Hi @edk 

The file you're looking for is: collection-list.liquid

Let me know if that helps!

Did we solve your issue? Like & Mark As Solution to help the community
Should you need any direct help: contact@jhkcreate.com

Learn more about us: jhkcreate.com
edk
Excursionist
27 2 18

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:

edk_0-1612119258784.png

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?  

 

 

edk
Excursionist
27 2 18

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.  

 

 

labradorSnoot
Visitor
2 0 0

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.

edk
Excursionist
27 2 18

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