sulu_page_breadcrumb

Returns the breadcrumb for a given page uuid as a list of pages:

Example:

{% for item in sulu_page_breadcrumb(resource.uuid) %}
    <a href="{{ sulu_content_path(item.url) }}">{{ item.title }}</a>
{% endfor %}

Complex Example:

{% for item in sulu_page_breadcrumb(resource.uuid, {
    'title': 'title',
    'url': 'url',
    'excerptTitle': 'excerpt.title',
    'uuid': 'object.resource.uuid',
}) %}
    <a href="{{ sulu_content_path(item.url) }}">{{ item.excerptTitle|default(item.title) }}</a>
{% endfor %}

Arguments:

  • uuid: string - UUID of page node for which to show the breadcrumb

  • properties: array<string, string> - Which properties to load. Default to “title” and “url”.

Returns:

  • array
    • title: Title of page

    • url: URL for page

    • targetType: Link type set via the “Enable Link” option in the page settings (page, article, media, or external)

    • use properties config to provide additional fields

Note

For articles using the page_tree_route property type, the breadcrumb of the assigned parent page can be rendered by passing the page UUID from the article’s URL object:

{% for item in sulu_page_breadcrumb(view.url.page.uuid) %}
    <a href="{{ sulu_content_path(item.url) }}">{{ item.title }}</a>
{% endfor %}