{%- if section_loop is defined -%}
    {%- set section_id = "section-"~section_loop.index -%}
{%- else -%}
    {%- set section_id = None -%}
{%- endif -%}
{% if content_block_loop is defined -%}
    {%- if section_loop is defined -%}
        {%- set content_block_id = "section-"~section_loop.index~"-content-block-"~content_block_loop.index -%}
    {%- else -%}
        {%- set content_block_id = "content-block-"~content_block_loop.index -%}
    {%- endif -%}
{%- else -%}
    {%- set content_block_id = "content-block" -%}
{% endif %}

{% if "styling" in content_block and "body" in content_block["styling"] -%}
    {% set content_block_body_styling = content_block["styling"]["body"] | render_styling -%}
{% else -%}
    {% set content_block_body_styling = "" -%}
{% endif -%}

<div id="{{content_block_id}}" {{ content_block | render_styling_from_string_template }}>

    {{ content_block | render_content_block }}

</div>