How do I identify if a reusable module is a block or a section?

How do I identify if a reusable module is a block or a section?

todayandafter
Shopify Partner
3 0 2

I've been using the following code previously to detect if a reusable piece of code is for a block or section however this no longer seems to work?  Has this been removed or is there an alternative method now?

 

 

{% comment %} Assign object as block or section {% endcomment %}
{% if type == 'block' %}
{%- assign object = block -%}
{% else %}
{%- assign object = section -%}
{% endif %}
{%- assign id = object.id -%}

{%- if object.settings.parameter -%}Hello world{%- endif -%}

 

Replies 0 (0)