{# Create Back button in the Pagemenu #}
{{- btn_a(current_menu.active_item.parent.text,
url=current_menu.active_item.parent.url,
design='light',
icon='chevron-left',
size='sm')
if current_menu.active_item.parent is defined
and current_menu.active_item.parent._endpoint -}}


{#- Create Pagemenu from the children of the current item. -#}
{%- for child in current_menu.active_item.children %}
{{- btn_a(child.text,
url=child.url,
design=child.type or 'light',
icon=child.icon,
size='sm')
if (child.pagemenu is defined and child.pagemenu())
and current_user.has_permission(child._endpoint) -}}
{% endfor -%}