Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
* Add a render function like symphony.
* Add drupal_block function
Then allow to do:
{% container "page" %}
{% region "sidebar-first" %}
<div ciass='sidebar-first'>
{% inner_region %}
{{ render_block('searchform') }}
{% endinner_region %}
<hr/>
</div>
{% endregion %}
{% region "content" %}
{% inner_region %}
{{ content }}
{% endinner_region %}
{% endregion %}
{% endcontainer "page" %}
{% container "page" %}
{% region "sidebar-first" %}
<div ciass='sidebar-first'>
{{ maybe_render(render_block('searchform')) }}
</div>
{% endregion %}
{% region "content" %}
{{ content }}
{% endregion %}
{% endcontainer "page" %}
{% container "page" %}
{% region "sidebar-first" %}
{% wrapper %}
<div ciass='sidebar-first'>
{% endwrapper %}
{{ render_block('searchform') }}
{% wrapper %}
<hr />
{% endwrapper %}
{{ render_block('login') }}
{% wrapper %}
</div>
{% endwrapper %}
{% endregion %}
{% region "content" %}
{% inner_region %}
{{ content }}
{% endinner_region %}
{% endregion %}
{% endcontainer "page" %}
{% container "page" %}
{% region "sidebar-first" %}
<div ciass='sidebar-first'>
{{ render_block('searchform') }}
<hr />
{{ render_block('login') }}
</div>
{% visibility %}
{{ blocks('searchform', 'login') }}
{{ title }}
{% endregion %}
{% endcontainer "page" %}
{% container "page" %}
{% region "sidebar-first" check_has_text %}
<div ciass='sidebar-first'>
{{ render_block('searchform') }}
<hr />
{{ render_block('login') }}
</div>
{% endregion %}
{% region "content" %}
{% endregion %}
{% endcontainer "page" %}
{% block 'sidebar-first' %}
{{ render_block('searchform') }}
{{ render_block('login') }}
{% endblock %}
{% container "page" %}
{% if block('sidebar-first') %}
<div ciass='sidebar-first'>
{{ block('sidebar-first') }}
</div>
{% endif %}
{% endcontainer %}
------
{% set sidebar_first %}
{{ render_block('searchform') }}
{% endset %}
{%
set page = {
sidebar_first: sidebar_first,
}
%}
---
{% if page.sidebar_first %}
<div id="sidebar-first" class="column sidebar">
{{ page.sidebar_first }}
{% set search = render_block('search') %}
{#
{% set search = render(drupal_block('search')) %}
#}
{#
{% set search = render(drupal_block('search', { num:3 })) %}
#}
{#
{{ dump(search_block|keys) }}
#}
{% inline_template search %}
<div{{ search.attributes }}>
{{ search.title_prefix }}
{% if search.label %}
<h2{{ search.title_attributes }}>Prefix: {{ search.label }}</h2>
{% endif %}
{{ search.title_suffix }}
<div{{ search.content_attributes }}>
{{ search.content }}
</div>
</div>
{% endinline_template %}
{#
{{ render_block('searchform') }}
{{ render_block('login') }}
#}
</div><!-- /#sidebar-first -->
{% endif %}
Comments
Comment #1
Fabianx CreditAttribution: Fabianx commentedComment #2
joelpittetMoving up to 8.1.x. Is this still something you think needs to get into core or maybe a contrib module would satisfy this @Fabianx?