How to identify specific theme app extension block in section file

How to identify specific theme app extension block in section file

Eniac
Shopify Partner
11 0 1

I want my page to be composed of theme app blocks as much as possible.

 

In Dawn theme I found a way to add custom block in section, use "type": "@app" and I can add my theme app in theme customize page.

 

{
    "name": "Product page main",
    "tag": "section",
    "class": "section",
    "blocks": [
        {
            "type": "@app"
        }
    ],
    "settings": []
}

 

 

But when I render the "@app" block in my section/xxx.liquid file, the only information I can get is that block.type is "@app", and an unique random block.id.

 

 

{% for block in section.blocks %}
	{% if block.type == '@app' %}
		{% render block %}	
		{% comment %} an random id: block.id {% endcomment %}
		{% comment %} name is blank: block.name {% endcomment %}
		{% comment %} settings is blank: block.settings {% endcomment %}
	{% endif %}
{% endfor %}

 

 

I couldn't identify these app by it's block.name or block.type, each of them is type "@app". For Example, I need to show only one of the App which contains "Ad" in it's name.

 

Is there any other additional information I can access in the liquid file ? 

Replies 0 (0)