Hello, I would like to link images to pages instead of linking to products. The featured collection section on Shopify is meant to display collections which only contain products. I would like to have the same section with the images, a text below the image and a button below that would link to a page.
This is the image of what the section looks like and I will add the code of the section (featured-collections.liquid) as well, I am using the prestige theme.
{%- if section.settings.layout_mode == ‘carousel’ -%}
{%- capture flickity_options -%}
{
“prevNextButtons”: true,
“pageDots”: false,
“wrapAround”: false,
“contain”: true,
“cellAlign”: “center”,
“watchCSS”: true,
“dragThreshold”: 8,
“groupCells”: true,
“arrowShape”: {“x0”: 20, “x1”: 60, “y1”: 40, “x2”: 60, “y2”: 35, “x3”: 25}
}
{%- endcapture -%}
{%- endif -%}
{%- capture section_settings -%}
{
“layout”: {{ section.settings.layout_mode | json }}
}
{%- endcapture -%}
{{ section.settings.title | escape }}
{%- endif -%}{%- if section.blocks.size > 1 -%}
{%- if collection != empty -%}
{{ section.blocks.first.settings.title | default: collection.title }}
{%- else -%}{{ 'home_page.onboarding.collection_title' | t }}
{%- endif -%} {%- endif -%}{%- for block in section.blocks -%}
{%- assign collection = collections[block.settings.collection] -%}
{%- if collection.products_count < block.settings.grid_items_count -%}
{%- assign item_count = collection.products_count -%}
{%- endif -%}
{%- if section.settings.layout_mode == ‘grid’ -%}
{%- capture products_placeholder -%}
{%- for i in (1..block.settings.grid_items_count) -%}
{%- if section.settings.show_product_info -%}
{{ 'home_page.onboarding.vendor_title' | t }}
{%- endif -%}{{ 'home_page.onboarding.product_title' | t }}
{%- if section.settings.layout_mode == ‘grid’ -%}
{%- if block.settings.button_text != blank -%}
{%- endif -%}{%- capture hack -%}
{%- comment -%}This is just an ugly hack to make those variables appear as part of the theme editor in the General Settings{%- endcomment -%}
{% if section.settings.layout_mode == ‘grid’ %}{{ settings.product_list_horizontal_spacing }},{{ settings.product_list_vertical_spacing }}{% endif %}
{%- endcapture -%}
{% schema %}
{
“name”: “Featured collections”,
“class”: “shopify-section–bordered”,
“max_blocks”: 2,
“settings”: [
{
“type”: “text”,
“id”: “title”,
“label”: “Sub-heading”,
“default”: “Featured collection”
},
{
“type”: “select”,
“id”: “layout_mode”,
“label”: “Layout”,
“options”: [
{
“value”: “grid”,
“label”: “Grid”
},
{
“value”: “carousel”,
“label”: “Carousel”
}
],
“default”: “grid”
},
{
“type”: “checkbox”,
“id”: “show_product_info”,
“label”: “Show product info”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_vendor”,
“label”: “Show vendor”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_color_swatch”,
“label”: “Show color swatch”,
“info”: “Some colors appear white? Learn more.”,
“default”: false
},
{
“type”: “header”,
“content”: “Grid”,
“info”: “Those settings apply only if the layout mode is set to grid.”
},
{
“type”: “select”,
“id”: “grid_mobile_items_per_row”,
“label”: “Products per row (mobile)”,
“options”: [
{
“value”: “1”,
“label”: “1”
},
{
“value”: “2”,
“label”: “2”
}
],
“default”: “2”
},
{
“type”: “range”,
“min”: 2,
“max”: 4,
“id”: “grid_desktop_items_per_row”,
“label”: “Products per row (desktop)”,
“default”: 4
}
],
“blocks”: [
{
“type”: “collection”,
“name”: “Collection”,
“settings”: [
{
“type”: “collection”,
“id”: “collection”,
“label”: “Collection”
},
{
“type”: “text”,
“id”: “title”,
“label”: “Heading”,
“info”: “If none is set, collection title is used.”
},
{
“type”: “range”,
“id”: “grid_items_count”,
“min”: 2,
“max”: 50,
“step”: 1,
“label”: “Products to show”,
“default”: 8
},
{
“type”: “text”,
“id”: “button_text”,
“label”: “Button text”,
“default”: “View all products”
}
]
}
],
“presets”: [
{
“category”: “Collection”,
“name”: “Featured collections”,
“settings”: {},
“blocks”: [
{
“type”: “collection”
}
]
}
]
}
{% endschema %}
Thank you !!
