page.list-collections doesn't capture image from subpage

creative_cloud
Tourist
5 0 1

I'm usin this code to create subcategories on a page:

https://shopify.dev/tutorials/feature-a-subset-of-collections-on-a-page

 

The problem is that if there is a subpage it doesn't capture an image for the page with sub-collections.

These two codes do have images for them but they have bad designs in Venture theme:

https://www.ecommerce-gold.com/how-to-create-a-page-of-collections-on-shopify/

https://gist.github.com/jonathanmoore/f56808c020020dbefa008687fa798d56

 

I managed to include pages with this minor modification in the official code but image for them is missing:

{% comment %}
Featuring collections on a page using a menu
https://shopify-dev.com/tutorials/feature-a-subset-of-collections-on-a-page
{% endcomment %}

<div class="page-width">

{% include 'breadcrumb' %}
<br>
{% comment %}
<h1 class="small--text-center">{{ page.title }}</h1>
{% endcomment %}

{%- assign collection_count = 0 -%}

{%- for link in linklists[page.handle].links -%}
{%- if link.type == 'collection_link' or link.type == 'page_link' -%}
{%- assign collection_count = collection_count | plus: 1 -%}
{%- endif -%}
{%- endfor -%}

{% assign number_rows = 1 %}

{% case collection_count %}
{% when 1 %}
{% assign grid_item_width = 'medium-up--one-half' %}
{% assign height = 450 %}
{% when 2 %}
{% assign grid_item_width = 'medium-up--one-half' %}
{% assign height = 450 %}
{% when 3 %}
{% assign grid_item_width = 'medium-up--one-third' %}
{% assign height = 330 %}
{% when 4 %}
{% assign grid_item_width = 'medium-up--one-quarter' %}
{% assign height = 235 %}
{% else %}
{% assign grid_item_width = 'medium-up--one-third' %}
{% assign height = 330 %}
{% assign number_rows = collection_count | divided_by: 3.0 | ceil %}
{% endcase %}

<div class="grid grid--no-gutters grid--uniform collection" data-number-rows="{{ number_rows }}">
{% assign row_number = 1 %}
{%- for link in linklists[page.handle].links -%}
{%- if link.type == 'collection_link' -%}
{%- assign featured_collection = collections[link.object.handle] -%}
{% if collection_count > 4 and forloop.index > 3 %}
{% assign row_number = forloop.index | divided_by: 3.0 | ceil %}
{% endif %}
{% include 'collection-grid-item' with stretch_collection_image: false, height: height %}
{%- endif -%}
{%- endfor -%}
{% comment %}
Include pages
{% endcomment %}
{% assign row_number = 1 %}
{%- for link in linklists[page.handle].links -%}
{%- if link.type == 'page_link' -%}
{%- assign featured_collection = pages[link.object.handle] -%}
{% if collection_count > 4 and forloop.index > 3 %}
{% assign row_number = forloop.index | divided_by: 3.0 | ceil %}
{% endif %}
{% include 'collection-grid-item' with stretch_collection_image: false, height: height %}
{%- endif -%}
{%- endfor -%}
</div>
</div>

KetanKumar
Shopify Partner
20685 2144 7830

@creative_cloud 

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community!
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes
creative_cloud
Tourist
5 0 1

Hello Ketan,

Thanks for lending your help. My store URL is: https://giftyourimagination.com

0 Likes
KetanKumar
Shopify Partner
20685 2144 7830

@creative_cloud 

can you please share particlur url

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes
KetanKumar
Shopify Partner
20685 2144 7830

@creative_cloud 

can you please upload custom image

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes
creative_cloud
Tourist
5 0 1

@KetanKumar 

Hello Ketan! I'm not having any image for these sub pages.  Earlier I tried a code provided here for featuring subset of collections on a page and it was capturing images for sub pages from collections but its design was looking awkward on venture like this: 

Untitled.png

 

0 Likes
KetanKumar
Shopify Partner
20685 2144 7830

@creative_cloud 

can you please use theme default section its work also custom page add other section same look

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes
creative_cloud
Tourist
5 0 1

@KetanKumar 

Hello Ketan! Thanks for your response. I tried that too but through this sub-pages featuring collection do not show up. I've linked custom pages to the navigation menu to make it simpler in a way that anyone can access the respective collection directly by just clicking on it instead of navigating the nested menu. This becomes too handy for mobile users. Please refer the image.Untitled.png

0 Likes