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.

Display reserved_related_entries in Related Entries Tag

July 22, 2009 8:00am

Subscribe [2]
  • #1 / Jul 22, 2009 8:00am

    Manji

    10 posts

    I tried this code but it only shows the reverse_related_entries code as a text.

    {exp:weblog:entries weblog="news" orderby="date" sort="desc" limit="1"}
      {related_entries id="relation_game"}
      {customfield}
    
        {reverse_related_entries weblog="news" orderby="date" sort="desc" limit="5"}
        {customfield}
        {/reverse_related_entries}
    
        {reverse_related_entries weblog="artikel" orderby="date" sort="desc" limit="5"}
        {customfield}
        {/reverse_related_entries}
    
      {/related_entries}
    {/exp:weblog:entries}

    Link

  • #2 / Jul 22, 2009 10:18am

    Boyink!

    5011 posts

    Hi…

    What’s the goal here?

    It makes me nervous to see the same weblog referenced in the outer loop as well as the reverse related entries loop.

  • #3 / Jul 22, 2009 10:50am

    Manji

    10 posts

    Hi,

    The Entries from my “News”- and “Artikel”-Weblog are related to “Game”-Weblog-Entries.
    When you read a “News” Entrie ( {exp:weblog:entries we(...) ), I want to show information from the related “Game”-Entrie and all other entries (“News” and “Artikel”) which are related to that game

    Sorry for my bad English

  • #4 / Jul 22, 2009 11:02am

    Boyink!

    5011 posts

    OK - so just to be clear, you have 3 weblogs:

    - News
    - Artikel
    - Game

    And when viewing one News article you want to show:

    - related entries from Artikels and Games
    - And also from within News weblog?

    If that’s the case there are two approaches to consider:

    1. Native EE code
    - Create unique field groups for all weblogs
    - Put a relationship field in the Artikel and Game weblogs, specifying the News weblog as the source.
    - Each entry in Artikel and Game would be assigned to a News entry.
    - On the news entry page, pull these entries with two reverse related entries loops

    {exp:weblog:entries weblog="news" orderby="date" sort="desc" limit="1"}
      {customfield}
    
        {reverse_related_entries weblog="game" orderby="date" sort="desc" limit="5"}
        {customfield}
        {/reverse_related_entries}
    
        {reverse_related_entries weblog="artikel" orderby="date" sort="desc" limit="5"}
        {customfield}
        {/reverse_related_entries}
    
    
    {/exp:weblog:entries}

    That takes care of 2 out of the 3.  The remaining question is for pulling other News entries, since you are already looking a News entry. Relationships are more commonly used to pull content from other weblogs.  You could use them here but since you can only relate one entry to one other entry it almost seems like categories might be a better fit - so each entry would be categorized then you could use the related categories mode to show other News entries from the same category as the one being viewed.

    2. Using Playa
    This might be a good use for the 3rd party Playa extension - which would allow you to create one relationship field in the News weblog, specify all three weblogs as possible sources for relationships, and choose them all from the News article they should appear with.

    Or you could create 3 playa fields, one each for the individual weblogs.

  • #5 / Jul 22, 2009 11:31am

    Manji

    10 posts

    That’s pity. I thought I could relate every weblog entries to a “Game”-Entrie, so i don’t have to related every news to the other Game-News and every Articles to the other Articles.

    It is possible to create 2 templates which only shows the related News and Articles of a Game and use the embed tag in the news template?

    Thanks for your help

  • #6 / Jul 22, 2009 11:39am

    Boyink!

    5011 posts

    That’s pity. I thought I could relate every weblog entries to a “Game”-Entrie, so i don’t have to related every news to the other Game-News and every Articles to the other Articles.

    Keep in mind - within one weblog entries are “related” purely by being in the same weblog.  You can, while on one News story, show a simple list of other news stories - just use another weblog entries tag.  I didn’t know if you wanted news articles be more closely related than that.  If so, then you’ll need to look at categories or specific News to News relationships.

    It is possible to create 2 templates which only shows the related News and Articles of a Game and use the embed tag in the news template?

    Lost me there.  Overall with relationships - either with native code or something like Playa - you pretty much need to specify what entries are related to what entries.  Something like “inheritance” isn’t easily pulled off.

    I think overall I’d look at using either Playa - and for every Game, News or Article choose all the entries it’s related to..or…

    Look at using Tags instead via the Solspace Tag module.

  • #7 / Jul 23, 2009 9:31am

    Manji

    10 posts

    I try Solspace’s Tag module. Thanks for your help.

    BTW: I’m already using Playa but I think it is too much work to relate everything, because I have to edit the old news again and again.

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

ExpressionEngine News!

#eecms, #events, #releases