Turbo theme Collections list page display collections twice

Highlighted
Tourist
9 0 3

Hello everyone,

Following this tutorial https://shopify.dev/tutorials/customize-theme-change-collections-page we've created menu items with selected collections in order to hide some featured or pre-order collections from collections list page.

We've customized our collection list liquid code replacing {% for collection in collections %} with {% for link in linklists.all-collections.links %} {% assign collection = link.object %}.

Everything looks good but collections are displayed twice now.

please visit: https://wooxstore.com/collections

How to solve?

We're using Turbo theme.

 

Thanks!

0 Likes
Highlighted
Shopify Partner
190 38 39

Hi @Fabio_WOOX 

Can you please share the template code.

Thanks

Vishvas Mishra

 

For Design, Development and custom changes Hire Me.
If your problem solved then Like & Accept this Solution.
Email ID: technicalvishvas@gmail.com
0 Likes
Highlighted
Tourist
9 0 3

Hi @VishvasMishra here the list-collection-template section:

{% comment %}
** Collection list - default view **
- Template
- Uses blocks
- This template can be viewed by going to /collections of the shop.
{% endcomment %}
 
{% if section.settings.image %}
  <header class="banner center page_banner dark-overlay-{{ section.settings.image_darken }}">
    {% include 'image-element', image: section.settings.image, alt: section.settings.image.alt, stretch_width: true, progressive: true %}
      {% if section.settings.display_collection_title %}
        <div class="caption">
          <h1 class="headline">{{ 'collections.general.title' | t }}</h1>
        </div>
      {% endif %}
  </header>
{% endif %}
 
<a name="pagecontent" id="pagecontent"></a>
 
<div class="container">
  {% paginate collections by section.settings.pagination_limit %}
    {% assign collections_per_row = section.settings.collections_per_row %}
    <div class="clearfix breadcrumb-collection">
      {% if section.settings.collection_breadcrumb %}
        <script type="application/ld+json">
          {
            "@context": "https://schema.org",
            "@type": "BreadcrumbList",
            "itemListElement": [
              {
                "@type": "ListItem",
                "position": 1,
                "item": {
                  "@id": "{{ shop.url }}",
                  "name": "{{ 'general.breadcrumbs.home' | t }}"
                }
              },
              {
                "@type": "ListItem",
                "position": 2,
                "item": {
                  "@id": "{{ shop.url }}/collections",
                  "name": "{{ 'collections.general.title' | t }}"
                }
              }
            ]
          }
        </script>
 
        <div class="eight columns breadcrumb_text">
          <a href="{{ shop.url }}" title="{{ shop.name | escape }}" class="breadcrumb_link">
            <span>{{ 'general.breadcrumbs.home' | t }}</span>
          </a>
          <span class="breadcrumb-divider">/</span>
          <a href="/collections" class="breadcrumb_link">
            <span>{{ 'collections.general.title' | t }}</span>
          </a>
 
          {% if paginate.pages != 0 %}
            <span class="breadcrumb-divider">/</span> {{ 'general.breadcrumbs.page' | t: current_page: paginate.current_page, pages: paginate.pages }}
          {% endif %}
        </div>
      {% endif %}
    </div>
    <div class="section clearfix">
      {% if section.settings.display_collection_title and section.settings.image == blank %}
        <div class="sixteen columns">
          <h1>{{ 'collections.general.title' | t }}</h1>
        </div>
      {% endif %}
      <div class="sixteen columns">
        <div class="feature_divider"></div>
      </div>
    </div>
 
    {% comment %}Check to see if sidebar should be enabled{% endcomment %}
    {% if section.blocks.size > 0 %}
      {% assign sidebar = true %}
    {% else %}
      {% assign sidebar = false %}
    {% endif %}
 
    {% if sidebar %}
      {% include 'sidebar' %}
      <div class="twelve columns list-collection-wrapper medium-down--one-whole">
    {% else %}
      <div class="sixteen columns list-collection-wrapper">
    {% endif %}
 
    <div class="list-collections clearfix equal-columns--clear equal-columns--outside-trim">
 
      {% for link in linklists.all-collections.links %}
  {% assign collection = link.object %}
        {% unless collection.handle == 'frontpage' %}
          {% capture collection_title %}{{ collection.title | escape }}{% endcapture %}
          <div class="
          {% if collections_per_row == 2 %}
            eight columns
          {% elsif collections_per_row == 3 %}
            one-third column
          {% else %}
            four columns
          {% endif %}
          thumbnail {% cycle 'even', 'odd' %}
          {% if settings.mobile_products_per_row == '1' %}
            medium-down--one-half
            small-down--one-whole
          {% else %}
            medium-down--one-half
            small-down--one-half
          {% endif %}">
 
        <div class="product-wrap">
          <div class="image__container">
            {% if collection.image %}
              {% assign collection_image = collection.image.src %}
            {% else %}
              {% assign collection_image = collection.products.first.featured_image %}
            {% endif %}
            {% include 'image-element', image: collection_image, alt: collection.title, object_fit: section.settings.align_height, max_height: section.settings.collection_height %}
          </div>
 
            <a href="{{ collection.url }}" title="{{ collection_title }}" class="hidden-product-link">{{ collection_title }}</a>
            {% if settings.thumbnail_hover_enabled %}
                <div class="thumbnail-overlay">
                <a href="{{ collection.url }}" title="{{ collection_title }}" class="hidden-product-link">{{ collection_title }}</a>
                  <div class="info">
                      <div class="collection-details">
                        <span class="title">{{ collection.title }}</span>
                      </div>
                      <a href="{{ collection.url }}" title="{{ collection_title }}"><span class="view_all">{{ 'collections.general.view_all' | t }}</span></a>
                  </div>
                </div>
            {% endif %}
            <a class="collection-info__caption {% if settings.thumbnail_hover_enabled %}hidden{% endif %}" href="{{ collection.url }}">
              <span class="title">{{ collection.title }}</span>
            </a>
          </div>
        </div>
        {% endunless %}
      {% endfor %}
      </div>
      {% include 'pagination' with sidebar %}
    </div>
  {% assign sp_paginate_by = paginate.page_size %}{% endpaginate %}
</div>
 
{% if section.settings.align_height %}
  <style>
    .list-collections .thumbnail img {
      max-height: {{ section.settings.collection_height }}px;
    }
  </style>
{% endif %}
 
thank you!
0 Likes