I'm revisiting a very old EE site, I had an embed that was used heavily in the site. The embed has some embed variables that could be used in simple conditionals to turn on and off various weblog parameters:

  {if embed:my_member_id}author_id="{embed:my_member_id}"{/if} 
  {if embed:my_paginate}paginate="{embed:my_paginate}" {/if} 

I want to convert this to a stash embed, but I'm stuck on how to include the stash vars in simple conditionals. I want to do something like the following:

{exp:stash:set_list name="st_images" parse_tags="yes" parse_depth="2" parse_conditionals="yes"}
    {if {stash:_author_id} != ""}author_id="{stash:_author_id}"{/if}
    {if {stash:_paginate} != ""}paginate="bottom"{/if}
    {if {stash:_paginate} != ""}disable="member_data|categories|pagination"{/if}
    {if {stash:_paginate} == ""}disable="member_data|categories"{/if}

Any ideas how I can use stash to turn on or off parameters in this way?


  • How/where are you setting the stash vars? Ex: {stash:_channel} Commented Oct 30, 2013 at 13:55
  • the code above is in the stash embed file. Those stash vars are being set in embed tag. {stash:embed context="@URI" name="news_vm" file_name="viewmodels:news_vm" parse_stage="both" stash:_channel="news" ... }
    – Joobs
    Commented Oct 31, 2013 at 22:23


Your Answer

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

Browse other questions tagged or ask your own question.