首页 > 解决方案 > Shopify:如果我的收藏成块,如何获取收藏网址

问题描述

我需要从内部有集合的所有块中获取所有 url:我已经尝试过了,但它没有显示任何内容:

{% for block in section.blocks %}
      <li class="best-seller-header__tag">{{block.settings.collection_id.url}}</li>
      {% endfor %}

这是我的架构,它似乎是正确的:

{% schema %}
    {
      "name": "Best Seller Section",
      "tag": "section", 
      "class": "best-seller",
      "max_blocks": 5,
      "blocks": [
        {
        "name": "collection",
        "type": "text",
        "settings": [
        {
          "type": "collection",
          "id": "collection_id", 
          "label": "Choose collection to show in Best Selling:"
        }
      ]
    }
    {% endschema %}

标签: htmljsoncontent-management-systemshopifyliquid

解决方案


推荐阅读