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 related entries / embeds

April 26, 2011 9:24am

Subscribe [2]
  • #1 / Apr 26, 2011 9:24am

    futuristonline

    43 posts

    Hi

    Version: 2.1.3

    Have a website we are working on at the moment that is multi page and multi language. We have created the need to have multiple related entries on one page. Its not working.

    Anyone have any way round doing multiple related entries?

    Have tried doing multiple embeds, so each embed contains 1 related entry but not a nice way of doing things and gets complicated if you need to make a change.

    Help!!!

    Thanks

    Steve

  • #2 / Apr 26, 2011 7:07pm

    Brandon Jones

    5500 posts

    Hi Steve,

    Can you show us a simple template that contains two related entries tags that don’t work, and let us know what the output is for you? It’d be helpful for us to reproduce the problem on our end. You should be able to use those tags as many times as you need, if I’m understanding what you’re doing correctly.

  • #3 / May 04, 2011 8:16am

    futuristonline

    43 posts

    Brandon

    Here is some sample code:

    <h1>Features</h1>
    {exp:channel:entries channel="cities" limit="1" search:pm_city__label="={segment_1}"}
        <h1>{title}</h1>
            <h2>{pm_city__label}</h2>
    <p>            {pm_city__description}</p>
    
    <p>                {related_entries id="pm_city__description_string"}<br />
                         {pm_string__label} <br />
                         {pm_string__content_{segment_2}} <br />
                    {/related_entries}</p>
    
    <p>                {related_entries id="pm_city__places"}<br />
                        Hi<br />
                    {/related_entries}</p>
    
    <p>                {related_entries id="pm_places__name"}<br />
                        </p><h2>{pm_string__label}</h2>
    <p>                    {pm_string__content_{segment_1}}<br />
                    {/related_entries}</p>
    
    <p>                 {embed="site/pm_features__feature" entry_ids="{pm_city__features:entry_ids}"}</p>
    
    <p>{/exp:channel:entries}

    Does this make sense?

    Steve

  • #4 / May 04, 2011 3:21pm

    Brandon Jones

    5500 posts

    Hi Steve,

    Thanks, that does make sense. What if you try with just two related_entries tag pairs and no embeds? I wonder if perhaps something else is going on here. Can you also verify how much memory is allocated to PHP on your server?

  • #5 / May 04, 2011 4:42pm

    futuristonline

    43 posts

    Brandon,

    Still doesn’t work if I only have two Related Entries there.

    Memory Limit is showing 128M

    Regards

    Steve

  • #6 / May 04, 2011 4:44pm

    futuristonline

    43 posts

    Brandon,

    We are also using the following

    Add-ons:
    Channel Images

    Extensions:
    Multi Relationship Extension
    Playa

    Fieldtypes:
    Multi Relationship Extension
    Playa

    If that helps?!?!?!?! 😊

    Steve

  • #7 / May 04, 2011 4:49pm

    Brandon Jones

    5500 posts

    OK, try disabling extensions as well. Essentially, try getting that working with the most basic of setups first, and we’ll go from there.

  • #8 / May 04, 2011 4:59pm

    futuristonline

    43 posts

    Okay,

    Extensions disabled.

    Have reduced the code to this:

    <h1>Features</h1>
    {exp:channel:entries channel="cities" limit="1" search:pm_city__label="={segment_1}"}
        <h1>{title}</h1>
            <h2>{pm_city__label}</h2>
    <p>            {pm_city__description}</p>
    
    <p>                {related_entries id="pm_city__description_string"}<br />
                         {pm_string__label} <br />
                         {pm_string__content_{segment_2}} <br />
                    {/related_entries}</p>
    
    <p>{/exp:channel:entries}

    Still not working.

    Steve

  • #9 / May 04, 2011 5:08pm

    Brandon Jones

    5500 posts

    Okay, one related_entries tag pair should definitely work, so something else is going on. What type of field is {pm_string__label}? I would get the standard (built-in) relationship fields working first without bringing Multi Relationship Extension or Playa into the mix - we cannot support those, unfortunately.

  • #10 / May 04, 2011 5:10pm

    futuristonline

    43 posts

    Okay - starting to get somewhere…

    This is the code now - had to add in a _ on the search:pm_city__label_=”={segment_1}” right after label to get the channgel entries <h1>

    and showing - which it now does. Given that the below related entries is a custom field that has a field type of Relationship, I have had to enable the extensions.
    <h1>Features</h1>
    {exp:channel:entries channel="cities" limit="1" search:pm_city__label_="={segment_1}"}
        <h1>{title}</h1>
            <h2>{pm_city__label}</h2>
    <p>            {pm_city__description}</p>
    
    <p>                {related_entries id="pm_city__description_string"}<br />
                         {pm_string__label} <br />
                         {pm_string__content_{segment_2}} <br />
                    {/related_entries}</p>
    
    <p>{/exp:channel:entries}

    Steve

  • #11 / May 04, 2011 5:13pm

    futuristonline

    43 posts

    Was writing as your message came in 😊

    {pm_string_label} is a text input field.

    So the {related entries id="pm_city_description_string"} is a relationship to Channel Strings.

  • #12 / May 05, 2011 1:21pm

    Kevin Smith

    4784 posts

    Hey Steve—

    Disabling extensions is usually a pretty important part of troubleshooting because it helps us isolate the problem area. In your case, if the custom field in question is using the native Relationship fieldtype, disabling extensions shouldn’t be a problem. If you’re using the fieldtype provided by the Multi Relationship add-on though, it could be that extension that’s causing the problem here, and of course, we’re unable to provide support for any third-party add-ons.

    Just to make sure we’re all on the same page here, I’m assuming you’re using this Multi Relationship add-on, correct?

    If this is on a public server, could I get a link to the example template you have trying to run this? And if at all possible, please turn on template debugging so we can get a better look at how the template engine is trying to parse this.

    Kevin

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

ExpressionEngine News!

#eecms, #events, #releases