Stash allows you to stash text and snippets of code for reuse throughout your templates.
GNU General Public License v3.0
197
stars
20
forks
source link
Setting variable in layout not passing value from child template #181
Open
GitTworn opened 1 year ago
In the global (most outer) layout I would like to get some member variables and pass them on the a template that uses.
_global_layout
In a child template I want to use them.
_newsletter_form
<input type="text" class="form-control" id="first_name" name="first_name" placeholder="First name" value="{if {exp:stash:not_empty name='st_logged_in_member_first_name'}}{exp:stash:get name='st_logged_in_member_first_name'}{/if}">
OR<input id='radio-mr' type="radio" name="gender" value="male" {if '{stash:embed:st_logged_in_member_gender}' == 'male'}checked="checked"{/if}> <--- does not work either
This is not working.
When I use
{stash:embed:st_logged_in_member_first_name}
it does give me the correct value, however I can't seem to get it to work with a conditional.