We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Related entries inside of related entries?

Development and Programming

Ray Brown's avatar
Ray Brown
33 posts
16 years ago
Ray Brown's avatar Ray Brown

Forgive me if this has already been covered. Say I’ve got several product lines, and I’m using Playa to dictate which products belong in each product line. So, each product line has many products, but each product also uses related entries to list what sizes and shapes the product comes in. Here’s my simplified template code:

{assign_variable:my_weblog="product_lines"}
{assign_variable:template_group="product"}
        
{exp:weblog:entries weblog="{my_weblog}"}
<h2>{title}</h2>
<div>
    <h3>{title} Products</h3>
    Our products...yada yada yada.

    {!-- Playa grabs the products in this product line. --}
    {related_entries id="product_line_products"}
        
        {!-- The title shows up fine because it is defined in the product entry. --}
        <h4><a href="http://{path=product/detail/{url_title}/}">{title}</a></h4>
        
        {!-- However, the following info prints correctly. I have a weblog for   --}
        {!-- different product packaging configurations, and I used a related    --}
        {!-- entry field in the product entry to associate it with the correct   --}
        {!-- packaging configuration.                                            --}
        {related_entries id="product_packaging"}{title}{/related_entries}
    {/related_entries}

</div>

{/exp:weblog:entries}

The nested ‘related_entries’ tag gets printed to the screen, and the parent ‘related_entries’ uses the nested {/related_entries} tag to close itself.

Is there any way around this?

Moved to Extensions: Discussions and Questions by Moderator

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

Playa is a third party offering, so I’ll move this to the extensions forum for additional community involvement.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.