Skip to content

Placeholder SVG Tag ​

Last updated View as Markdown

Generates an HTML <img> tag for a placeholder illustration. Use it where a section has no product, collection or image to show yet.

Parameters ​

  • The filter is applied to a placeholder name.
  • The first parameter is the class of the tag. It is placeholder-svg by default.

Names ​

NameSize
product-1 to product-5512 × 512
collection-1 to collection-3512 × 512
hero-1 to hero-31600 × 500
image512 × 512
  • Product and collection names have a version with no background: add -transparent, for example product-1-transparent.
  • Hero names have a mobile version: add -mobile, for example hero-1-mobile (500 × 250).
  • An unknown name gives the image placeholder.

Example ​

liquid
{%- if block.settings.product -%}
  {% render 'product-card', product: block.settings.product %}
{%- else -%}
  {{ 'product-1' | placeholder_svg_tag: 'card-image' }}
{%- endif -%}

Output