ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Nested Reverse Related Entries in Playa

April 11, 2011 10:41am

Subscribe [2]
  • #1 / Apr 11, 2011 10:41am

    OwensDDB

    42 posts

    I’m building a site that has Continents, Regions and Cities. All are entered as separate records which are related to each other via Playa. So when I add “New South Wales” I drag over “Australia” as the Continent. When I add “Sydney” I choose “New South Wales as the region”.

    However, I need to renders all three levels on one page. Playa uses {exp:playa:parents} as a replacement for reverse_related_entries, but this cannot be nested. So, I tried embedding another template within, but this isn’t working either.

    {exp:channel:entries channel="destination" limit="1" sort="desc" orderby="title" status="not closed"} 
         <h1>{title}</h1>
         {dest_description}
    
        <!-- Related Subections --> 
        {exp:playa:parents}
            <h2>{title}</h2>
    <p>        {region_description}<br />
            {embed="includes/locale"}<br />
        {/exp:playa:parents}<br />
       <br />
    {/exp:channel:entries}

    The “Includes” Locale is

    {exp:playa:parents}
            <h2>{title}</h2><p>}<br />
        {/exp:playa:parents}

    Am I Doing It Wrong?

  • #2 / Apr 26, 2011 5:27pm

    blendimc

    150 posts

    Your embed isn’t aware of whats going on in the template it was called from. It runs completely separatley. You need to pass it some id or something than rerun the channel entries tag in order to get it working.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases