Search code examples
templatesexpressionengine

Expression Engine: Embed Template Variables not Working


I am using the EE {embed} tag to bring in templates and as outlined in the documentation I am setting variables in the tag to be used in the template.

All this is working fine for the first template I am embedding but any following {embed} tag does not seem to be able to set variables and all the variables within the template get outputted as plain text?

Code:

//main-template.html

{embed="includes/header" body_class="home" title="What Is"}
{embed="page/sub-nav" nav_title="what-is"}
{embed="includes/footer" }

The {title} for the header file outputs as "What Is" and the {nav_title} for the sub-nav file gets outputed as "{nav_title}"


Solution

  • I had forgotten to put the the "embed" keyword into the variable. So {nav_title} should have been {embed:nav_title}