I’m trying to hide the subcollections then a child page doesn’t exist. https://animondo.dk/collections/horse
Under “HEST” → “BID” it’s okay the subcollections are shown
But under “Trensebid” it should link to anything.
This is my “main-collection.liquid”
{%- liquid
if section.settings.show_image_behind_heading and collection.image
assign header_image_enabled = true
else
assign header_image_enabled = false
endif
assign current_sort = collection.sort_by | default: collection.default_sort_by
assign show_filters = section.settings.enable_filtering
if collection.filters == empty
assign show_filters = false
endif
-%}
{%- liquid
if section.settings.enable_subcoll and section.settings.subcoll_menu != blank
assign current_link_parent = false
for link in linklists[section.settings.subcoll_menu].links
if link.links != empty
if link.type == ‘collection_link’ and link.object.handle == collection.handle
assign current_link_parent = link
break
elsif link.type == ‘catalog_link’ and collection.handle == ‘all’
assign current_link_parent = link
break
endif
endif
if link.links != blank and current_link_parent == false
for child_link in link.links
if child_link.type == ‘collection_link’ and child_link.object.handle == collection.handle
if child_link.links == empty
assign current_link_parent = link
else
assign current_link_parent = child_link
endif
break
endif
if child_link.type == ‘catalog_link’ and collection.handle == ‘all’
if child_link.links == empty
assign current_link_parent = link
else
assign current_link_parent = child_link
endif
break
endif
if child_link.links != blank and current_link_parent == false
for child_child_link in child_link.links
if child_child_link.type == ‘collection_link’ and child_child_link.object.handle == collection.handle
assign current_link_parent = child_link
break
elsif child_child_link.type == ‘catalog_link’ and collection.handle == ‘all’
assign current_link_parent = child_link
break
endif
endfor
endif
endfor
endif
endfor
endif
-%}
{%- if current_link_parent -%}
{%- assign subcoll_count = 0 -%}
{% capture subcollection_html %}
{% if section.settings.subcoll_style == ‘buttons’ %}
{% if header_image_enabled %}
{%- liquid
assign show_header = false
if section.settings.show_title
assign show_header = true
endif
if collection.description != blank and section.settings.coll_desc_pos == ‘above’
assign show_header = true
endif
if current_link_parent and section.settings.subcoll_style == ‘buttons’
assign show_header = true
endif
-%}
{%- if show_header -%}
{{ collection.title | escape }}
{%- endif -%}{% if collection.description != blank and section.settings.coll_desc_pos == ‘above’ %}
{%- if current_link_parent and section.settings.subcoll_style == ‘buttons’ -%}
{{ subcollection_html }}
{%- endif -%}
{{ collection.title | escape }}
{%- endif -%}{% if collection.description != blank and section.settings.coll_desc_pos == ‘above’ %}
{%- if current_link_parent and header_image_enabled and section.settings.subcoll_style != ‘buttons’ -%}
{{ subcollection_html }}
{%- endif -%}
{% if section.settings.show_total and paginate.items > 0 %}
{{ 'collections.general.no_matches' | t }}
{% else %}{% endpaginate %}
{% if collection.description != blank and section.settings.coll_desc_pos == ‘below’ %}
{% schema %}
{
“name”: “Collection pages”,
“settings”: [
{
“type”: “header”,
“content”: “Heading”
},
{
“type”: “checkbox”,
“id”: “show_title”,
“label”: “Show collection title”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_image_behind_heading”,
“label”: “Show collection image behind title”,
“default”: true
},
{
“type”: “select”,
“id”: “heading_image_height”,
“label”: “Heading image height”,
“options”: [
{
“value”: “small”,
“label”: “Compact”
},
{
“value”: “medium”,
“label”: “Small”
},
{
“value”: “large”,
“label”: “Medium”
},
{
“value”: “huge”,
“label”: “Large”
}
],
“default”: “medium”
},
{
“id”: “overlay_style”,
“type”: “select”,
“label”: “Overlay style”,
“default”: “shadow”,
“options”: [
{
“value”: “full”,
“label”: “Tint”
},
{
“value”: “box”,
“label”: “Box”
},
{
“value”: “shadow”,
“label”: “Text shadow”
},
{
“value”: “full image-overlay–bg-shadow”,
“label”: “Text shadow and tint”
},
{
“value”: “no_background”,
“label”: “No background”
}
]
},
{
“type”: “select”,
“id”: “coll_desc_pos”,
“label”: “Description position”,
“default”: “above”,
“options”: [
{
“value”: “above”,
“label”: “Below collection title”
},
{
“value”: “below”,
“label”: “Below products”
}
]
},
{
“type”: “header”,
“content”: “Layout”
},
{
“type”: “range”,
“id”: “coll_num_per_page_int”,
“min”: 16,
“max”: 50,
“step”: 2,
“label”: “Number of products to show per page”,
“default”: 24
},
{
“type”: “range”,
“id”: “grid”,
“label”: “Products per row”,
“min”: 2,
“max”: 5,
“step”: 1,
“default”: 4
},
{
“type”: “checkbox”,
“id”: “show_vendor”,
“label”: “Show product vendors”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_total”,
“label”: “Show product total”,
“default”: true
},
{
“type”: “header”,
“content”: “Filters”
},
{
“type”: “checkbox”,
“id”: “enable_filtering”,
“label”: “Enable filtering”,
“info”: “Customize filters”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “collapse_tag_sidebar_by_default”,
“label”: “Collapse filter column”,
“default”: false
},
{
“type”: “select”,
“id”: “collapse_filters_method”,
“label”: “Filter row collapse”,
“default”: “over-12”,
“options”: [
{
“value”: “none”,
“label”: “None”
},
{
“value”: “over-6”,
“label”: “Over 6 items”
},
{
“value”: “over-12”,
“label”: “Over 12 items”
},
{
“value”: “over-18”,
“label”: “Over 18 items”
},
{
“value”: “all”,
“label”: “All rows”
}
]
},
{
“type”: “checkbox”,
“id”: “show_filter_counts”,
“label”: “Show filter counts”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_disabled_filters”,
“label”: “Show filters with zero results”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “ajax_products”,
“label”: “Filter and sort collections without loading a new page”,
“default”: true,
“info”: “Some apps require this to be disabled”
},
{
“type”: “checkbox”,
“id”: “auto_apply_hide_unavailable”,
“label”: “On selecting a filter, automatically apply ‘Hide out of stock’”,
“default”: false,
“info”: “Requires Availability filter to be enabled”
},
{
“type”: “checkbox”,
“id”: “enable_sticky_filter”,
“label”: “Enable stick on scroll”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “filter_two_columns”,
“label”: “Two column filter values”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “coll_show_sort”,
“label”: “Show sorting dropdown”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “coll_show_feat”,
“label”: “Show ‘Featured’ in sorting dropdown”,
“default”: false
},
{
“type”: “header”,
“content”: “Subcollections”
},
{
“type”: “paragraph”,
“content”: “The current collection is located in the menu, and any other collections within that dropdown menu are displayed. Read more”
},
{
“type”: “checkbox”,
“id”: “enable_subcoll”,
“label”: “Enable subcollections”,
“info”: “A menu must be selected below”,
“default”: true
},
{
“type”: “link_list”,
“id”: “subcoll_menu”,
“label”: “Subcollections menu”,
“info”: “This is usually your main menu”,
“default”: “main-menu”
},
{
“type”: “select”,
“id”: “subcoll_style”,
“label”: “Subcollections style”,
“default”: “buttons”,
“options”: [
{
“value”: “buttons”,
“label”: “Buttons”
},
{
“value”: “gallery”,
“label”: “Gallery”
}
]
},
{
“type”: “header”,
“content”: “Subcollection gallery layout”
},
{
“type”: “select”,
“id”: “subcoll_gall_shape”,
“label”: “Image shape”,
“default”: “sq”,
“options”: [
{
“value”: “l-21”,
“label”: “Landscape (2x1)”
},
{
“value”: “l-64”,
“label”: “Landscape (6x4)”
},
{
“value”: “l-5x4”,
“label”: “Landscape (5x4)”
},
{
“value”: “sq”,
“label”: “Square (1x1)”
},
{
“value”: “p-4x5”,
“label”: “Portrait (4x5)”
}
]
},
{
“type”: “select”,
“id”: “image_position”,
“label”: “Image alignment”,
“info”: “Used to keep the subject of your image in view”,
“default”: “center center”,
“options”: [
{
“value”: “top left”,
“label”: “Top left”
},
{
“value”: “top center”,
“label”: “Top center”
},
{
“value”: “top right”,
“label”: “Top right”
},
{
“value”: “center left”,
“label”: “Middle left”
},
{
“value”: “center center”,
“label”: “Middle center”
},
{
“value”: “center right”,
“label”: “Middle right”
},
{
“value”: “bottom left”,
“label”: “Bottom left”
},
{
“value”: “bottom center”,
“label”: “Bottom center”
},
{
“value”: “bottom right”,
“label”: “Bottom right”
}
]
},
{
“id”: “subcoll_gall_enable_margin”,
“type”: “checkbox”,
“label”: “Add spacing”,
“default”: true
},
{
“id”: “subcoll_gall_full_width”,
“type”: “checkbox”,
“label”: “Full page width”,
“default”: false
},
{
“id”: “subcoll_gall_overlay_style”,
“type”: “select”,
“label”: “Overlay style”,
“default”: “shadow”,
“options”: [
{
“value”: “full”,
“label”: “Tint”
},
{
“value”: “box”,
“label”: “Box”
},
{
“value”: “shadow”,
“label”: “Text shadow”
},
{
“value”: “full image-overlay–bg-shadow”,
“label”: “Text shadow and tint”
},
{
“value”: “no_background”,
“label”: “No background”
}
]
},
{
“type”: “select”,
“id”: “subcoll_gall_text_alignment”,
“label”: “Text overlay position”,
“options”: [
{
“value”: “top left”,
“label”: “Top left”
},
{
“value”: “top center”,
“label”: “Top center”
},
{
“value”: “top right”,
“label”: “Top right”
},
{
“value”: “center center”,
“label”: “Middle”
},
{
“value”: “bottom left”,
“label”: “Bottom left”
},
{
“value”: “bottom center”,
“label”: “Bottom center”
},
{
“value”: “bottom right”,
“label”: “Bottom right”
}
],
“default”: “center center”
},
{
“type”: “select”,
“id”: “subcoll_gall_mobile_layout”,
“label”: “Mobile layout”,
“info”: “Mobile layout always uses 5x4 images”,
“default”: “2”,
“options”: [
{
“value”: “1”,
“label”: “1 item”
},
{
“value”: “2”,
“label”: “2 items”
},
{
“value”: “hide”,
“label”: “Hide”
}
]
}
]
}
{% endschema %}

