To insert a pair of {exp:channel:entries}
tags inside yourself, you need to insert the template into another template using the {embed}
variable.
To do this, simply change the tag of the records of the main channel so that it looks like this:
{exp:channel:entries channel="pages"} {reverse_related_entries sort="desc"} {if show_testimonial} {embed="template_group/template"} {/if} {/reverse_related_entries} {/exp:channel:entries}
Then create a new template with the contents of a pair of tags of nested channels:
{exp:channel:entries channel="testimonials" orderby="random" limit="1"} <blockquote> {testimony} <cite> <span class="cite_name">{cite_name}</span><br /> <span class="cite_org">{cite_org}</span><br /> <span class="cite_title">{cite_title}</span> </cite> </blockquote> {/exp:channel:entries}
What you can include in any ExpressionEngine template using the following syntax, as shown above:
{embed="template_group/template"}
Using built-in templates is the standard way for some ExpressionEngine and Parse Order quirks (PDF, 32KB), but they carry a penalty for execution with them, so remember how to choose between {embed}
and a {snippet}
.
rjb
source share