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

Mastop
  • 1

1 Answers1

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.

Alexander Schranz
  • 2,154
  • 2
  • 25
  • 42