Thanks for the super fast answer! Itâs not working though.
if $title = = get('title') ?? 'Default title'; is inside the snippet, the snippet will work with snippet('test'); but the title passed with snippet('test', array('title' => 'my-title')); does not show.
There shouldnât be two â==â. And this code $title = get('title') ?? 'Default title'; shouldnât be inside the snippet if you want to pass it to the snippetâŚ
Hmm, I think I was not clear so I will try to rephrase this:
I want to use a snippet in different places. Sometimes I want to pass variables to it, sometimes not. (It look like in my first post.)
If there is no variable, the snippet needs to work anyway. (Actually it does not even need a default value: if the variable is here, the snippet does something with it, if not, it does not)