Published by Mijingo

tips icon image

EE Insider Tips
Sponsored by Mijingo's EE 2 Screencasts

ExpressionEngine mini-howtos created by the EE Insider community.

How to embed weblog:entries tags

  • Posted by Andy Harris
  • June 10, 2009

In ExpressionEngine, you cannot embed exp:weblog:entries tags. For example, this will not work:

{exp:weblog:entries weblog="parent"}
    
<h1>Title</h2>
    
{exp:weblog:entries weblog="children"}
        {details}
    {
/exp:weblog:entries}
{
/exp:weblog:entries} 

In order to make it work, you have to create a new template for the inner section, and embed it into the main template. In this example, you would change the above template to something like this:

{exp:weblog:entries weblog="parent"}
    
<h1>Title</h2>
    
{embed="includes/child"}
{
/exp:weblog:entries} 

Then, you would create a new template inside the includes template group, and call it child, which would contain this code:

{exp:weblog:entries weblog="children"}
    {details}
{
/exp:weblog:entries} 

And this would work like a charm!

JonnyUK02:23 on 06.10.2009

This is very similar to a tip I added yesterday, “display-entries-from-one-weblog-based-on-the-results-of-another”

http://eeinsider.com/tips/view/display-entries-from-one-weblog-based-on-the-results-of-another/