This is my _layouts/main.twig:
<body {% if bodyId is defined %}id="{{ bodyId }}"{% endif %}>
{% include '_layouts/header.twig' %}
{% block main %}
{% endblock %}
</body>
Then i have blog/_entry.twig with:
{% extends '_layouts/main' %}
{% block main %}
{% switch entry.entryType.entryIs.value %}
{% case 'listing' %}
{% include 'blog/_listing.twig' %}
{% case 'listingSimple' %}
{% include 'blog/_listing-simple.twig' %}
{% case 'article' %}
{% include 'blog/_single-entry.twig' %}
{% endswitch %}
{% endblock %}
If I do:
{% set bodyId = 'article' %}
in my blog/_single-entry.twig that does not work.
But it works if i set bodyId in my index.twig in the root that is not a include.