Hi!
I am developing a theme app extension based on App Blocks. I am trying to find out the section group (header
, footer
or different) of the App Block that a merchant places using the Theme Editor.
Shopify in their liquid documentation say that for a section object the location
property should work like in the description:
The scope or context of the section (template, section group, or global).
Sections can have one of four different location types. For sections rendered within a template, the location will be
template
. For sections rendered within a section group, the location will be the section group type, e.g.,header
,footer
,custom.<type>
. Sections rendered statically will bestatic
. Finally, if you’re still usingcontent_for_index
, then the value will becontent_for_index
.
But when used in code:
`<my-element
id=“shopify-app-{{ block.id }}”
data-template=“{{ template.name }}”
data-section-location=“{{ section.id }}”
data-section-type=“{{ section.type }}”
data-section-location=“{{ section.location }}”
data-section-closest-type=“{{ closest.type }}”
`
It does not work. As an example this is a placement slightly below the header:
<my-element id="shopify-app-AMm1zS0w4Z29LTCtPd__my_test_app_app_block_AGDjAW" data-section-id="sections--15714603532341__1738684653765e7c81" data-section-type="" data-section-location="" data-section-closest-type="" data-purchase-amount="61595" data-locale="en-GB" data-preloaded="true"> </my-element>
We would like to have an information that the placement actually is in the header. But neither of:
section.id
section.type
section.location
closest.type
does not provide the necessary information. It blocks development of more advanced app blocks features.
Did any of you encountered a similar issue? It seems like a elementary information, so I hope Shopify has a possibility to do something like this, right?
Kind regards,
Pawel