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_entries and paginate

August 02, 2007 10:39pm

Subscribe [2]
  • #1 / Aug 02, 2007 10:39pm

    cookiemonster

    7 posts

    2 questions:
    1. How can I paginate reversed related entries? Is it possible?

    {exp:weblog:entries weblog="book_author" status="open" limit="1" rdf="off"}
    <h2>{weblog} - {title}</h2>
    
    <p>{reverse_related_entries weblog="book" status="open" limit="15" paginate="bottom"}<br />
        </p><h3>{title} - {related_entries id="book_author"}{title}{/related_entries}</h3>
    <p>  {if no_reverse_related_entries}<br />
        </p><h3>No entries</h3>
    <p>  {/if}<br />
      {paginate}Page {current_page} of {total_pages} : {pagination_links}{/paginate}<br />
    {/reverse_related_entries}<br />
    {/exp:weblog:entries}

    2. How can I print the {title} of the related entry inside the reversed tag? (perhaps PHP is the only solution)

    {related_entries id="book_author"}{title}{/related_entries}

    This is rendered as

    {REL[book_author]cX2hsWW4REL}
  • #2 / Aug 05, 2007 8:50pm

    cookiemonster

    7 posts

    Anyone?

  • #3 / Aug 06, 2007 9:16am

    Derek Jones

    7561 posts

    1) No, pagination is not natively available.  You could simulate it by adding your own links and URL segments via PHP and hiding entries that are not within the current pages pagination bounds, but it would require a custom solution.

    2) Is “book_author” a valid related field in the weblog within which you are placing that tag?  Your general question, yes, to display the parent weblog entry’s title inside the output of the related entries tag pair, you could use PHP on output, setting the variable above the related tag pair, and echoing within.

  • #4 / Aug 06, 2007 9:46pm

    cookiemonster

    7 posts

    Thanks Derek
    1. I don’t understand why pagination is not available (perhaps is not that simple) but it will be great to have it in future versions of EE.

    2. book_author is a valid related field. I will have to do it with PHP then :(

  • #5 / Aug 06, 2007 10:03pm

    Derek Jones

    7561 posts

    1) It’s both a performance issue as well as a URL issue.  How does the weblog entries tag know that the pagination segment is to apply to the related entries and not to itself?  It would either require a different type of pagination segment, or an additional weblog entries special-case tag parameter, neither of which are very desirable.

    2) If you have {REL[book_author]cX2hsWW4REL} ending up on your rendered template, then there is something amiss.  The marker tags should never appear in your rendered template.  What build are you running?  And you may want to supply the full template you are using so we can eliminate tag or parsing interference.

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

ExpressionEngine News!

#eecms, #events, #releases