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.

related_entries inside reverse_related_entries

July 11, 2011 12:59pm

Subscribe [2]
  • #1 / Jul 11, 2011 12:59pm

    davedriesmans

    14 posts

    intro: i want to show a list of books from a certain category
    this includes the author name which is in third channel with an ee relationship

    how can i access the author?

    {exp:channel:entries channel="categories" orderby="entry_date" sort="desc"}
        {reverse_related_entries sort="desc"}
                <h2>{related_entries id="author_link"}{title}{/related_entries}</h2>
    <p>            {price}</p>
    
    <p>            {description}<br />
        {/reverse_related_entries}<br />
    {/exp:channel:entries}

    this works, but doesn’t filter on the category

    {exp:channel:entries channel="books" orderby="entry_date" sort="desc"}
        <h2>{related_entries id="author_link"}{title}{/related_entries}</h2>
    <p>    {title}</p>
    
    <p>    {description}<br />
    {/exp:channel:entries}

    Moved to Community Help forum by Moderator

  • #2 / Jul 12, 2011 11:23am

    Sue Crocker

    26054 posts

    Hi, dave.

    It might make more sense for you to go into more detail about your content - and what you want to display ultimately. This is more of a How Do I (Community Help forum) kind of topic.

  • #3 / Jul 12, 2011 11:34am

    davedriesmans

    14 posts

    well imagine a little book shop.
    you have three tables/channels: books - categories - authors
    the book channel contains two relationships : category and author

    if i want to show the books info straigth i have no trouble to access the author with

    {related_entries id="author_link"}{title}{/related_entries}
    {title} ...

    BUT i want to show all books starting from a certain category,
    it works perferc twith the reverse_related_entries (see code on top)
    but no idea how to access the book author

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

ExpressionEngine News!

#eecms, #events, #releases