0

The snippet return "null" when I try to get it in my varaible.

 {% set snippets = sulu_snippet_load_by_area('banner') %}
 {{ dump(snippets) }}

and

<key>banner</key>

<meta>
    <title lang="en">Banner</title>
    <title lang="fr">Bannière</title>
</meta>

<areas>
    <area key="banner">
        <meta>
            <title lang="fr">Banniere</title>
            <title lang="en">Banner</title>
        </meta>
    </area>
</areas>

<properties>
    ....

I try to use the sulu_snippet_load_default instead but it returns me an empty array. If I try to dump the content.snippet I manage to get my values.

enter image description here

Thank you

1 Answer 1

0

The snippet will only be returned when you are creating first a snippet of that type. going to your Webspace click on Default Snippets Tab and select the snippet you did create before.

Keep in mind the sulu_snippet_load_by_area will return you the single snippet you did select there. So not an array of snippets.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.