Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Sulu 3.0 - Snippets do not have their "template" type in the view data #8478

@benr77

Description

@benr77

In Sulu 2.6, we were able to loop over snippets defined inside our sidebar snippet, and use their template value to construct a Twig template path - e.g.

{% for index, snippet in content.sidebar.snippets %}
    <div class="snippet-container">
        {{ include('includes/snippets/' ~ view.sidebar.snippets[index].template ~ '.html.twig', {
            data: snippet,
            view: view.sidebar.snippets[index],
        }, ignore_missing: true) }}
    </div>
{% endfor %}

However, now in Sulu 3.0 the view.sidebar.snippets property does not exist, and there is no way to get the snippet template type string as we previous did using view.sidebar.snippets[index].template etc.

Is there a new way to do this now? Or is it possible to add this to 3.0?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions