forked from Sylius/Stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbreadcrumbs.html.twig
More file actions
30 lines (26 loc) · 1.3 KB
/
breadcrumbs.html.twig
File metadata and controls
30 lines (26 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{% from '@SyliusBootstrapAdminUi/shared/helper/breadcrumbs.html.twig' import breadcrumbs %}
{% if hookable_metadata.context.metadata is defined %}
{% set metadata = hookable_metadata.context.metadata %}
{% set resource_name = hookable_metadata.configuration.resource_name|default(metadata.applicationName~'.ui.'~metadata.pluralName) %}
{% else %}
{% set resource_name = hookable_metadata.configuration.resource_name|default(null) %}
{% endif %}
{% set configuration = hookable_metadata.context.configuration|default(null) %}
{% if configuration is not null %}
{% set index_url = path(
configuration.vars.index.route.name|default(configuration.getRouteName('index')),
configuration.vars.index.route.parameters|default(configuration.vars.route.parameters|default({}))
) %}
{% endif %}
{% if index_url is defined and resource_name is not null %}
{{ breadcrumbs([
{ name: 'sylius.ui.dashboard', url: path('sylius_admin_ui_dashboard'), active: false },
{ name: resource_name, url: index_url, active: false },
{ name: 'sylius.ui.new'|trans, active: true}
]) }}
{% else %}
{{ breadcrumbs([
{ name: 'sylius.ui.dashboard', url: path('sylius_admin_ui_dashboard'), active: false },
{ name: 'sylius.ui.new'|trans, active: true}
]) }}
{% endif %}