Images and data not loading into framework--featured-collections.liquid

siteadvice
New Member
1 0 0

This is a bit of a strange issue.

We have a theme called Debut which has been published for several months and until this week there was a section near the top of the Home page displaying featured collections using framework--featured-collections.liquid.

However, the section suddenly does not have any data. Instead we get a placeholder that shows a default placeholder image, with "Collection title" underneath, and which does not have a working link to any collection. This is what is being displayed:

featured-collections.png

Obviously, I have had to disable that section for the time being.

No one has been making design changes to the site and the images are all still on the server. If you view each collection in the Shopify dashboard, the images are there. It doesn't help if I try changing one collection for a different one - the image/title/link doesn't appear.

When viewed in the "Blockshop", everything appears to be working normally, with collection titles and images where you would expect to see them:

featured-collections-2.png

I'm pasting the code here, although I think it's unlikely to be an issue with the template, since it has not been altered.

Does anyone have any suggestions?

Thanks!

{% comment %} Translations {% endcomment %}
{% assign collection_title_t = 'home.onboarding.collection_title' | t %}

{% comment %} Variables {% endcomment %}
{% assign heading = section.settings.heading | escape %}

{% comment %} View {% endcomment %}
<div
  class="featured-collections--root"
  style="{% render 'framework--background-colors', bg_color: section.settings.background-color %}"
  data-js-class="FrameworkFeaturedCollections"
  data-mobile-width="{{ section.settings.mobile-width }}"
  data-section-id="{{ section.id }}"
  data-container="section"
>
  {% if heading != blank %}
    <div class="featured-collections--header" data-container="panel">
      <div data-container="block">
        <h2 class="featured-collections--heading" data-item="section-heading">{{ heading }}</h2>
      </div>
    </div>
  {% endif %}

  <div class="featured-collections--body"
    data-container="panel"
    data-columns="{{ section.settings.width }}"
    data-mobile-columns="{{ section.settings.mobile-width }}"
  >
    {% for block in section.blocks %}
      {% comment %} Variables {% endcomment %}
      {% if block.settings.collection.size > 0 %}
        {% assign collection = collections[block.settings.collection] %}
        {% assign link = collection.url %}

        {% if collection.image %}
          {% capture image %}
            {%
              render "framework--image",
              image: collection.image,
              full_width: true
            %}
          {% endcapture %}
        {% else %}
          {% capture image %}
            {%
              render "framework--image",
              image: collection.products.first.featured_media.preview_image,
              full_width: true
            %}
          {% endcapture %}
        {% endif %}

        {% assign title = collection.title %}
      {% endif %}

      {% comment %} Onboarding {% endcomment %}
      {% unless block.settings.collection.size > 0 %}
        {% assign link = '#' %}
        {% capture image %}
          {%
            render "framework--placeholder",
            type: "image",
            aspect_ratio: 1
          %}
        {% endcapture %}
        {% assign title = collection_title_t %}
      {% endunless %}

      {% comment %} View {% endcomment %}
      <div
        class="featured-collections--item"
        {{ block.shopify_attributes }}
        data-container="block"
      >
        <a href="{{ link }}">
          <div class="featured-collections--image">{{ image }}</div>
          <h3 class="featured-collections--title" data-item="block-heading">
            {{ title }}
          </h3>
        </a>
      </div>
    {% endfor %}
  </div>
</div>

{% schema %}
  {
    "name": "Collection list",
    "settings": [
      {
        "type": "header",
        "content": "Layout and color"
      },
      {
        "id": "background-color",
        "label": "Background color",
        "type": "select",
        "options": [
          { "label": "None", "value": "none" },
          { "label": "Light grey", "value": "light" },
          { "label": "Accent", "value": "accent" }
        ],
        "default": "none"
      },
      {
        "id": "width",
        "label": "Blocks per row",
        "type": "range",
        "min": 2,
        "max": 6,
        "step": 1,
        "default": 3
      },
      {
        "id": "mobile-width",
        "label": "Blocks per row for small devices",
        "type": "radio",
        "options": [
          { "value": "1", "label": "1"},
          { "value": "2", "label": "2"}
        ],
        "default": "2"
      },
      {
        "type": "header",
        "content": "Content"
      },
      {
        "type": "text",
        "id": "heading",
        "label": "Heading",
        "default": "Collection list"
      }
    ],
    "blocks": [
      {
        "type": "collection",
        "name": "Collection",
        "settings": [
          {
            "type": "collection",
            "id": "collection",
            "label": "Collection"
          }
        ]
      }
    ],
    "presets": [
      {
        "name": "Collection list",
        "category": "Collection",
        "blocks": [
          {
            "type": "collection"
          },
          {
            "type": "collection"
          },
          {
            "type": "collection"
          }
        ]
      }
    ]
  }
{% endschema %}

 

0 Likes