Closed timkelty closed 10 years ago
Basically, I'm trying to replace this code with a stash:extend
:
{exp:stash:set
name="content"
replace="no"
}
{stash:embed:views:page
process="start"
parse="no"
}
{/exp:stash:set}
{exp:stash:extend}
supports all the SET parameters, since you are effectively setting a variable with the embed as the value. You can't pass parameters to the embed beyond embed variables in the form stash:my_var="value"
.
Extend is really just a convenience tag to make the block/extension template inheritance pattern explicit. Likewise a Stash embed is really just a wrapper for stash:get. It's all about the semantics.
If you need more control over the embed being passed then you can do that explicitly with a {exp:stash:set}
wrapped around an embed, as you have above.
Well I'm wrong (forgot!), you can pass parameters to the embed. I'm not sure it's as legible though?
{exp:stash:extend:block name="content" with="views:page process='start' parse='no'"}
{stash:my_var}value{/stash:my_var}
{/exp:stash:extend:block}
Or as a single tag
{exp:stash:extend name="content" with="views:page process='start' parse='no'"}
Yep, makes sense to me.
Thanks!
Is it possible to do this with a list item as well? Or would you have to just do:
{stash:foo}{stash:embed:my_view process="start" parse="no"}{/stash:foo}
Yes, if that is in the host EE template it should work. If not, you may need to prefix the embed with exp: - {exp:stash:embed:my_view ...}
Thanks!
I wanted to set replace="no" on
stash:extend
, just as I would on aset
orstash:embed
.It appears to work, but the wiki doesn't say it accepts params from
set
orembed
, so I just wanted to make sure that made sense to do.How about
process="start" parse="no"
, should those work the same too?