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.

Reverse Related Entry - Display Title Field

September 19, 2011 12:56pm

Subscribe [2]
  • #1 / Sep 19, 2011 12:56pm

    mjpvltech

    1 posts

    Hi EE Folks,

    I’m having a little bit of trouble displaying related entry fields.  Right now, I’m running a reverse_related query on a channel called “member_titles”—the primary channel is “members.”

    I’m doing a reverse related query so that I can sort members by their titles.

    Ideally, I’d like to be able to do something like this:

    {exp:channel:entries channel="member_titles" orderby="member_title_order" sort="asc"}
    
        {reverse_related_entries channel="board_members" sort="asc"}
    
            <div class="bio"> 
                    
                <h3>{title}, {related_entries id="member_title"}{title}{/related_entries}</h3><p> <br />
                {board_member_bio} <br />
                    <br />
            </div></p>
    
    <p>    {/reverse_related_entries}</p>
    
    <p>{/exp:channel:entries}


    Any idea as to how I might accomplish the above task? Right now it just displays some random ID code as output—i.e.:

    {REL[member_title]jRaIn1sJREL}

     
    Thank you in advance!!!!

    Darin

  • #2 / Sep 19, 2011 10:57pm

    Dan Decker

    7338 posts

    Darin,

    Welcome to the Forums and ExpressionEngine!

    I’m afraid the issue here is that you can’t have a {related_entries} tag in side a {revers_related_entries} tag pair. If you can give us a clear outline of what you would like to accomplish, perhaps we can work together to sort it out?

    Cheers,

  • #3 / Sep 19, 2011 11:51pm

    mjpvltech

    1 posts

    Dan,

    Thanks for the reply—that’s a helpful start.

    What I have are two channels, one exists only for the purposes of a relationship between the two channels.

    The first channel contains member information (name, jobtitle, etc).  The second is simply a list of the possible jobtitles that members can have (executive editor, etc).  The jobtitle channel’s “title” field is the relationship field in the member information channel.

    What I’d like to be able to do, is to:

    1. display members, sorted by jobtitles;
    2. display member names next to their job titles in the sorted list.

    I think that the code in the first post should serve as an example of pseudo-code for these goals, at least.

    Thanks again for your help,

    Darin

  • #4 / Sep 20, 2011 8:49pm

    Dan Decker

    7338 posts

    Darin,

    Ah, excellent! Thanks for the clarification. What you are trying to achieve might be better handled by using Categories. Essentially you would scrap your job titles channel, and replace that with categories. Using categories is kind of “relationships for free”, read up on them here and let me know if you have further questions.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases