{% doc %} Renders a collection card. @param {collection} card_collection - The collection to display. Pass a blank value to render a placeholder card. @param {number} columns - The number of columns used to calculate the responsive image size. @param {string} [media_aspect_ratio] - The image aspect ratio. Allowed values are `adapt`, `portrait`, and `square`. Defaults to `square`. @param {boolean} [extend_height] - Whether the card fills its available container space. Defaults to `false`. @param {string} [wrapper_class] - A custom wrapper class. When blank or `none`, the collection-card wrapper and settings are used. @param {string} [placeholder_image] - The placeholder SVG name to render when the collection is blank. @example {% render 'card-collection', card_collection: collection, media_aspect_ratio: 'adapt', columns: 3 %} {% enddoc %} {%- liquid assign ratio = 1 if card_collection.featured_image and media_aspect_ratio == 'portrait' assign ratio = 0.8 elsif card_collection.featured_image and media_aspect_ratio == 'adapt' assign ratio = card_collection.featured_image.aspect_ratio endif if ratio == 0 or ratio == null assign ratio = 1 endif assign card_color_scheme = settings.card_color_scheme assign card_style = settings.card_style if wrapper_class == null or wrapper_class == 'none' assign card_color_scheme = settings.collection_card_color_scheme assign card_style = settings.collection_card_style endif -%}
{%- if card_collection.featured_image -%}
{{ card_collection.featured_image.alt | escape }}
{%- endif -%} {%- if card_collection == blank -%}
{{ placeholder_image | placeholder_svg_tag: 'placeholder-svg' }}
{%- else -%}

{%- if card_collection.title != blank -%} {{- card_collection.title | escape -}} {%- else -%} {{ 'onboarding.collection_title' | t }} {%- endif -%} {%- if card_collection.description == blank -%} {{- 'icon-arrow.svg' | inline_asset_content -}} {%- endif %}

{%- if card_collection.description != blank -%}

{{- card_collection.description | strip_html | truncatewords: 12 -}} {{- 'icon-arrow.svg' | inline_asset_content -}}

{%- endif -%}
{%- endif -%}
{%- if card_collection != blank and card_style == 'card' or card_collection.featured_image -%}

{%- if card_collection.title != blank -%} {{- card_collection.title | escape -}} {%- else -%} {{ 'onboarding.collection_title' | t }} {%- endif -%} {%- if card_collection.featured_image or card_collection.description == blank -%} {{- 'icon-arrow.svg' | inline_asset_content -}} {%- endif %}

{%- if card_collection.featured_image == null and card_collection.description != blank -%}

{{- card_collection.description | strip_html | truncatewords: 12 -}} {{- 'icon-arrow.svg' | inline_asset_content -}}

{%- endif -%}
{%- endif -%} {%- if card_collection == blank -%} {%- endif -%}