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.

Relating Entries question

December 15, 2010 12:23pm

Subscribe [4]
  • #1 / Dec 15, 2010 12:23pm

    Marcuse

    166 posts

    I have Channel x with fields:

    title
    x1 - Text Input
    x2 - Textarea

    I have Channel y with fields:

    title
    y1 - Relationship - custom field options ‘Channel x’
    y2 - Textarea

    Publish one record into ‘Channel y’ and choose y1 a input from ‘Channel x’ see attachment

    If I see the record in the front-end and it is reacting on the relating tag because it gives the output ‘nothing’ but it shoud be ‘Relating: {y2}

    {exp:channel:entries channel="Channel x" disable="paginate|member_data|trackbacks" sort="desc" limit="1"}
    
    Text: {x2}
        
    {related_entries id="y1"}
    
             {if no_related_entries}
    
              <h2>nothing</h2>
    
    <p>         {/if}</p>
    
    <p>        </p><h2>Relating: {y2} </h2>
    
    <p>{/related_entries}</p>
    
    <p>{/exp:channel:entries}

    What is going wrong

  • #2 / Dec 15, 2010 3:42pm

    Hi Marcus,

    I think you might want reverse related entries, rather than related entries. Try this:

    {exp:channel:entries channel="Channel X" disable="paginate|member_data" sort="desc" limit="1"}
    
      Text: {x2}
      
      {reverse_related_entries channel="Channel Y"}
        {if no_reverse_related_entries}
          <h2>nothing</h2>
    <p>    {/if}<br />
        </p><h2>Relating: {y2}</h2>
    <p>  {/reverse_related_entries}</p>
    
    <p>{/exp:channel:entries}

    Also, EE2 doesn’t have trackbacks, so there’s no reason to disable them.

  • #3 / Dec 16, 2010 3:22am

    John Henry Donovan

    12339 posts

    Marcuse,

    Ruthie is correct here. You will need to use the reverse related entries tags.

    Be sure and let us know if that worked for you. Thanks Ruthie

  • #4 / Dec 16, 2010 4:51pm

    Marcuse

    166 posts

    Ruthie Thanks

    Works fine noe (don’t know why) but works

    Greetings

  • #5 / Dec 16, 2010 5:43pm

    Ingmar

    29245 posts

    Very glad to hear it. Please post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases