I’m developing section templates but in order to keep my code DRY, I want to use a base section that I can extend with blocks like I do for my base page template:
base seciton code
<!--
templateType: section
label: SECTION LABEL
isAvailableForNewContent: false
-->
{% dnd_section
padding={
'default': {
'top': '8rem',
'bottom': '8rem',
'left': '2rem',
'right': '2rem'
},
'mobile': {
'top': '2rem',
'bottom': '2rem',
'left': '2rem',
'right': '2rem'
}
},
background_color="#111317",
max_width=1200,
full_width=false
%}
{% dnd_column %}
{% dnd_row %}
{% block module %}
{% endblock %}
{% end_dnd_row %}
{% end_dnd_column %}
{% end_dnd_section %}
section code:
<!--
templateType: section
label: My custom section
isAvailableForNewContent: true
-->
{% extends '../base/base-section.html' %}
{% block module %}
<!-- module snippet here -->
{% end_dnd_module %}
However, I get the following error: The section can only have one root-level “dnd_section” tag.
Ideally, I would also be able to pass in an argument for the background color but I would like to get this work first if possible.