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.

How to set friendly reverse related entries and ID param

July 30, 2009 7:34am

Subscribe [2]
  • #1 / Jul 30, 2009 7:34am

    denza

    13 posts

    If I need to use two relation fields in my entry: rel_1 and rel_2.
    to display related entries I use

    {related_entries id="rel_1"} ...

    and to display reverse related entries I suppose to use

    {reverse_related_entries id="rel_2"} But it has not id param…

    So I need not display all of reverse related entries - both of fields rel_1 and rel_2 - only one field rel_2 I need

  • #2 / Jul 30, 2009 9:24am

    Boyink!

    5011 posts

    Are both fields relating posts from the same weblog?

  • #3 / Jul 30, 2009 9:34am

    denza

    13 posts

    Are both fields relating posts from the same weblog?

    Yes (and I suppose to use multiple weblogs)

  • #4 / Jul 30, 2009 9:40am

    Boyink!

    5011 posts

    Just so I’m clear you have:

    Weblog A with two relationship fields rel_1 and rel_2.  Both of these relationship fields are creating relationships to entries from Weblog B.

    Then from the Weblog B perspective you want to pull reverse related entries, but only from one of the fields?

    If that’s the case I think you are running into a limitation of the reverse related entries tag.  You can specify different weblogs to pull from but not specific fields.

  • #5 / Jul 30, 2009 10:00am

    denza

    13 posts

    That`s why I can`t understand why limitation of the reverse related entries tag is exist - I mean absent ID param 😊

  • #6 / Jul 30, 2009 10:01am

    Boyink!

    5011 posts

    You can always make a feature request…;)

    But if you post more about what your goals are there might be a better way to solve it.

  • #7 / Jul 31, 2009 8:02am

    denza

    13 posts

    But if you post more about what your goals are there might be a better way to solve it.

    The goals

    I have: webblog with entries which have among other things text field, which contains advertisement of this entry

    I want: to place this ads on chosen entries

    How I suppose to do it on publish page: for example using playa. When I publish entry (A) I can set entries (B & C) in playa field on which I want to advertise published entry (A).

    To display on this entries (B & C) my ad of entry (A) I use:

    {reverse_related_entries orderby="random" limit="1" weblog="myweblog"}
        {ad}
    {/reverse_related_entries}

    everything fine, BUT

    I suppose to have simultaneously vice versa functionality.

    I want on publish page for entry (B) to choose entry (A) in ANOTHER playa field for displaying entry`s (A) ad on entry`s (B) page.

    I use:

    {myplaya orderby="RAND()" limit="1" weblog="myweblog"}
        {ad}
    {/myplaya}

    wonderful, BUT
    I do not need to display this relation in first case, that`s why I want to limit reverse related entries by the field in which I set this relation…

  • #8 / Jul 31, 2009 11:41am

    Boyink!

    5011 posts

    I’m not sure I’m quite following…but there should be no need to establish relationships twice between two entries. 

    Assuming you choose entry B from a Playa field on Entry A’s publish form, you can:

    -Display Entry B as an ad while displaying Entry A on the site -using the custom/playa field loop, or:
    - Display Entray A as an ad while displaying Entry B - using a reverse related entries loop.

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

ExpressionEngine News!

#eecms, #events, #releases