diff --git a/layout/password.liquid b/layout/password.liquid index 9bae7f5768..cd12bf0568 100644 --- a/layout/password.liquid +++ b/layout/password.liquid @@ -1,3 +1,4 @@ +{% include 'shogun-content-handler' %}
@@ -192,7 +193,9 @@ - + + {% render 'shogun-head' %} + diff --git a/layout/theme.liquid b/layout/theme.liquid index e118c7cd80..5ac7f8795b 100644 --- a/layout/theme.liquid +++ b/layout/theme.liquid @@ -1,3 +1,4 @@ +{% include 'shogun-content-handler' %} @@ -301,7 +302,9 @@ document.documentElement.classList.add('shopify-design-mode'); } - + + {% render 'shogun-head' %} + diff --git a/layout/theme.shogun.landing.liquid b/layout/theme.shogun.landing.liquid index 5def182c87..ab3c770110 100644 --- a/layout/theme.shogun.landing.liquid +++ b/layout/theme.shogun.landing.liquid @@ -1,3 +1,4 @@ +{% include 'shogun-content-handler' %} {% comment %} Auto-generated by Shogun. This file can be re-written at any time. @@ -309,6 +310,8 @@ This file can be re-written at any time. } + + {% render 'shogun-head' %} diff --git a/snippets/shogun-content-handler.liquid b/snippets/shogun-content-handler.liquid new file mode 100644 index 0000000000..0c81e7cae0 --- /dev/null +++ b/snippets/shogun-content-handler.liquid @@ -0,0 +1,62 @@ +{% comment %} +Auto-generated by Shogun. +This file can be re-written at any time. +{% endcomment %} + +{% assign template_suffix = template.suffix %} + +{% if article %} + {% assign content = article %} +{% elsif page %} + {% assign content = page %} +{% elsif product %} + {% assign content = product %} +{% elsif collection %} + {% assign content = collection %} + +{% endif %} + +{% capture content_for_header %} + {{ content_for_header }} + {% render 'shogun-products', content: content %} +{% endcapture %} + +{% if content.metafields.shogun.json_template_snippets %} + {% capture content_for_header %} + {{ content_for_header }} + {{ content.metafields.shogun.json_template_snippets.value['head'][template_suffix] }} + {% endcapture %} + + {% capture content_for_body %} + {{ content_for_layout }} + {{ content.metafields.shogun.json_template_snippets.value['body'][template_suffix] }} + {% endcapture %} +{% endif %} + +{% if content.metafields.shogun.json_template_html_wrapper %} + {% assign json_template_config = content.metafields.shogun.json_template_html_wrapper.value %} + {% capture content_for_layout %} + {{ + json_template_config.html + | replace: json_template_config.content_for_layout_placeholder, content_for_layout + | replace: json_template_config.page_variant_id_placeholder, json_template_config.template_suffix_to_variant_id_map[template_suffix] + }} + {% endcapture %} +{% endif %} + +{% if content.metafields.shogun.json_template_optimizer %} + {% capture content_for_header %} + + {{ content_for_header }} + + {{ content.metafields.shogun.json_template_optimizer.value['head'] }} + {% endcapture %} + + {% capture content_for_layout %} + + {{ content_for_layout }} + + {{ content.metafields.shogun.json_template_optimizer.value['body'] }} + {% endcapture %} +{% endif %} + diff --git a/snippets/shogun-head.liquid b/snippets/shogun-head.liquid new file mode 100644 index 0000000000..849d4a95c1 --- /dev/null +++ b/snippets/shogun-head.liquid @@ -0,0 +1,21 @@ +{% comment %} +Auto-generated by Shogun. +This file can be re-written at any time. +{% endcomment %} + +{% if product and product.metafields.shogun.head %} + {{product.metafields.shogun.head}} +{% endif %} + +{% if collection and collection.metafields.shogun.head %} + {{collection.metafields.shogun.head}} +{% endif %} + +{% if page and page.metafields.shogun.head %} + {{page.metafields.shogun.head}} +{% endif %} + +{% if article and article.metafields.shogun.head %} + {{article.metafields.shogun.head}} +{% endif %} +