Theme markup Depict needs on collection pages for content cards, image settings and product duplicates to work.
This page is aimed at a merchant’s theme developer: the person editing the
collection section and product card snippet of the Shopify theme.
Depict’s script needs to know three things about your collection page:
where the product grid starts, where it ends, and which product each card
belongs to. It reads all of this from the DOM, so the integration is a few
small additions to your theme’s collection section and product card snippet.
As the first child of the product grid element (the element whose direct
children are the product cards), add a <depict-grid-start-beacon> element.
It carries the pagination state of the current page so Depict can place
content cards and duplicates at the right positions.
<depict-grid-start-beacon {% liquid comment Set the defaults that apply when a theme loops over collection.products without pagination. endcomment assign depict_page_size = "50" if paginate.page_size assign depict_page_size = paginate.page_size endif assign depict_pagination_pages = "1" if paginate.pages assign depict_pagination_pages = paginate.pages endif assign depict_current_page = "0" if paginate.current_page comment Make depict_current_page 0-indexed; that is what the script expects. endcomment assign depict_current_page = paginate.current_page | minus: 1 endif %} style="display:none;" data-paginate=' { "page_size": {{ depict_page_size }}, "pages": {{ depict_pagination_pages }}, "current_page": {{ depict_current_page }} } '></depict-grid-start-beacon>
<div data-depict-product-id="15371075486078" data-depict-default-image="files/Main_b13ad453-477c-4ed1-9b43-81f3345adfd6.jpg" data-depict-hover-image="files/Main_0a40b01b-5021-48c1-80d1-aa8ab4876d3d.jpg"> <!-- rest of product card --></div>
The image attributes hold the media path exactly as Shopify returns it
(for example files/Main_….jpg), not a full CDN URL. Use the variable name
your card snippet already has for the product (product, card_product,
and so on).
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.