Stash embeds can be parsed at three different stages in the parse order of their parent template:
process="start"
- embed the template before any other variables and tags in your template are parsed. The tags in the embed will be fully parsed before being included in the parent template, unless you set parse="no"
. If you do set parse="no"
, the embed behaves like a native EE template partial.
process="inline"
- embed the template in the "natural" parse order of the template. This means EE parses the embed like any other tag.
process="end"
(default) - embed the template at the end of template parsing after other tags and variables in the parent template have been parsed. This is like EE's standard embed.
To enable the process="start"
functionality, it was necessary to use an extension hook (template_fetch_template
) to parse the Stash embeds before EE's main parsing routines are run. This hook looks for embeds beginning {stash:embed...}
, checks if they need to be parsed immediately, and if not replaces them with the tag form {exp:stash:embed...}
for parsing by EE later on.
If the embed syntax {stash:embed}
was not parsing it must be because there was a problem with Stash being triggered on the template_fetch_template
hook. That could be because another add-on using the same hook is not checking the value of ee()->extensions->last_call
or is not returning a value as it should. Or it could be that the Stash extensions are not installed or enabled.
You can disable other add-on extensions one-by-one to determine if a conflict is the cause of your issue. And you should check that the following extensions are installed and enabled for Stash in exp_extensions table:
- stash_fetch_template
- stash_post_parse
- template_fetch_template
- template_post_parse
Using the {exp:stash:embed}
syntax is fine providing you don't need to use the process="start"
functionality.