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 relations

February 14, 2012 6:40am

Subscribe [2]
  • #1 / Feb 14, 2012 6:40am

    Omar De-Giuli

    10 posts

    Hi Folks

    Is there a way to nest multiple related_entries in a reverse_related_entries tag?

    Like this:

    {exp:channel entries .......}
    
    .......
    
    <table class="kurse_listing" width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
          <th scope="col">Nr.</th>
          <th scope="col">Kurs</th>
          <th scope="col">Datum</th>
          <th scope="col">Zeit</th>
          <th scope="col">Ort</th>
          <th scope="col"> </th>
       </tr>
            {reverse_related_entries
                channel="kursdaten"
                orderby="kursdaten_datum_von"
                sort="asc"
                status="not closed"
                start_on="{current_time}"
             }
       <tr>
          <td>{entry_id}</td>
          <td>{title}</td>
          <td>{kursdaten_datum_von format="%d.%m.%Y"}</td>
          <td>{kursdaten_datum_von format="%G.%i"} - {kursdaten_datum_bis format="%G.%i Uhr"}</td>
          <td>{related_entries id="kursdaten_ort"}{location_ort}{/related_entries}</td>
          <td>
          <a href="http://{comment_entry_id_auto_path}"><button class="button small blue right_align">Details</button></a>
           {if logged_in_member_id == author_id OR member_group == '1' OR member_group == '8'}
            <a href="http://{entry_id_path=kurse/admin}"><button class="button small green right_align">Admin</button></a>
           {/if}
          </td>
       </tr>
             {/reverse_related_entries}
    </table>
    
    ........
    
    {/exp:channel:entries}

    I have seminar-dates that are grabbed by {reverse_relation_entries} and get displayed in a table-list. between the {reverse_related_entries} tag i need to get other data from a third channel with the {related_entries} tag. in this case it is the location of the seminar. with this code i don’t get a result in the tag {location_ort}. did anyone has a idea how i can solve this?

    many thanks in advance for a idea 😊

    omar

  • #2 / Feb 14, 2012 7:46pm

    Sean C. Smith

    3818 posts

    Hi dataquestag,

    For nested relations I would strongly recommend looking at Playa as that is not available out of the box with ExpressionEngine.

    Sean

  • #3 / Feb 15, 2012 2:50am

    Omar De-Giuli

    10 posts

    Hi Sean

    Thanks for your answer. Yes, i know Playa indeed… maybe i have to buy it for my reasons. but theoretically i can do it also with a sql query too? or it is a security or performance problem to put php oder sql statements in a template?

    greetings from switzerland

    omar

  • #4 / Feb 15, 2012 7:49am

    Omar De-Giuli

    10 posts

    I solved it by buying playa… this extension is just great! you can close this tread.

    cheers

    omar

  • #5 / Feb 16, 2012 4:40pm

    Shane Eckert

    7174 posts

    Hello dataquestag,

    I am glad to hear it! Playa is pretty awesome.

    Happy coding!

    Regards,

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

ExpressionEngine News!

#eecms, #events, #releases