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.

Next/Prev Entry Tags Empty

December 15, 2011 7:47pm

Subscribe [5]
  • #1 / Dec 15, 2011 7:47pm

    khowe

    12 posts

    This question may be related to a resolved thread.

    I am having a similar issue, however, our url_title is segment_3; within the first few that is referenced.

    I have verified that our next/prev tags are outside the {/exp:channel:entries} tag.

    Output Shows The Following Error

    Channel Next/Prev Entry tag error: Could not resolve single entry page id.

    Our URLs look like this:

    http://xsight.three29media.com/blog/post/omg-this-is-a-awesome-post

    We also tried to create a URL w/o the POST in the URL, so segment_2 became the url_title but that didn’t help.

    Here is what we have for the prev/next tags:

    {exp:channel:next_entry channel="blog"}
      Next entry: <a href="http://{path=blog/blog-post}">{title}</a>
    {/exp:channel:next_entry}
    
    {exp:channel:prev_entry channel="blog"}
    Previous entry: <a href="http://{path=blog/blog-post}">{title}</a>
    {/exp:channel:prev_entry}

    Not really sure what we are doing wrong or what is missing from the code. Any help would be greatly appreciated. I don’t want to have to plugin every site we develop to get prev/next working.

  • #2 / Dec 19, 2011 5:05am

    John Henry Donovan

    12339 posts

    Hi khowe,

    What version and build of EE are you using?
    Are you using any add-ons?

    try adding the url_title= parameter into the mix and see if that works for you. Any custom statues?

    {exp:channel:next_entry channel="blog" url_title="{segment_3}" status="not closed"}
      Next entry: <a href="http://{path=blog/blog-post}">{title}</a>
    {/exp:channel:next_entry}
    
    {exp:channel:prev_entry channel="blog" url_title="{segment_3}" status="not closed"}
    Previous entry: <a href="http://{path=blog/blog-post}">{title}</a>
    {/exp:channel:prev_entry}
  • #3 / Dec 19, 2011 2:25pm

    khowe

    12 posts

    Nope, that didn’t work either.

    I am using EE v2.3.1 - Build: date 20111017

    I have the following modules installed:
    Assets 1.1.3
    Freeform 3.1.0
    Low Reorder 1.2.1
    Tagger 3.0.0
    Taxonomy 2.0.7.2
    Wygwam 2.3.4.1
    Playa 4.0.5
    Matrix 2.2.2.1

    (0.163165 / 14.06MB)      Calling Class/Method: Channel/next_entry
    (0.163435 / 14.05MB)       -> Class Called: Channel
    (0.163531 / 14.06MB)       -> Method Called: next_entry
    (0.163840 / 14.06MB)      Channel Next/Prev Entry tag error: Could not resolve single entry page id.
    (0.163969 / 14.06MB)       -> Data Returned
    (0.164033 / 14.05MB)      Calling Class/Method: Channel/prev_entry
    (0.164263 / 14.05MB)       -> Class Called: Channel
    (0.164348 / 14.06MB)       -> Method Called: prev_entry
    (0.164629 / 14.06MB)      Channel Next/Prev Entry tag error: Could not resolve single entry page id.
    (0.164773 / 14.06MB)       -> Data Returned
  • #4 / Dec 19, 2011 2:53pm

    khowe

    12 posts

    Okay so I have been tweaking with the tags and I cannot get the error to go away. I even took tag code from a friend of mine who uses EE and his code parses fine. Not really sure where to go from here.

    Here is my code in the template, trying to force the entry_id just for testing. But on the previous entry I am using the segment.

    {exp:channel:next_entry channel="blog" entry_id="49"}
    Next entry: <a href="/blog/blog-post/{url_title}">{title}</a>
    {/exp:channel:next_entry}
    
    {exp:channel:prev_entry channel="blog" url_title="{segment_3}"}
    Previous entry: <a href="/blog/blog-post/{url_title}">{title}</a>
    {/exp:channel:prev_entry}


    Here is the debug output

    (0.020352 / 7.04MB)       - Beginning Tag Processing -
    (0.020394 / 7.04MB)      Parsing Tags in Template
    (0.020442 / 7.05MB)      Tag: {exp:channel:next_entry channel="blog" entry_id="49"}
    (0.020578 / 7.05MB)      Closing Tag Found
    (0.020707 / 7.05MB)      Tag: {exp:channel:prev_entry channel="blog" url_title="omg-this-is-a-awesome-post"}
    (0.020840 / 7.05MB)      Closing Tag Found
    (0.020950 / 7.06MB)      Tag: {exp:channel:entries channel="blog" url_title="omg-this-is-a-awesome-post"}
    (0.021082 / 7.06MB)      Closing Tag Found
    (0.021204 / 7.06MB)      Processing Tags
    (0.021263 / 7.06MB)      Module Tag: Channel/next_entry
    (0.021309 / 7.06MB)      Module Tag: Channel/prev_entry
    (0.021353 / 7.06MB)      Module Tag: Channel/entries
    (0.062010 / 9.54MB)      Beginning Final Tag Data Processing
    (0.062055 / 9.54MB)      Calling Class/Method: Channel/next_entry
    (0.062333 / 9.54MB)       -> Class Called: Channel
    (0.062439 / 9.55MB)       -> Method Called: next_entry
    (0.063134 / 9.55MB)      Channel Next/Prev Entry tag error: Could not resolve single entry page id.
    (0.063271 / 9.55MB)       -> Data Returned
    (0.063334 / 9.54MB)      Calling Class/Method: Channel/prev_entry
    (0.063565 / 9.55MB)       -> Class Called: Channel
    (0.063659 / 9.55MB)       -> Method Called: prev_entry
    (0.063949 / 9.56MB)      Channel Next/Prev Entry tag error: Could not resolve single entry page id.
    (0.064074 / 9.55MB)       -> Data Returned

     

  • #5 / Dec 19, 2011 4:40pm

    ahmad saad

    364 posts

    I search for this error message in ee files and I find that the only way to show this message is as the file tells:

    // no results or more than one result?  Buh bye!

    please test this code first:

    {exp:channel:next_entry}
    Next entry: <a href="/blog/blog-post/{url_title}">{title}</a>
    {/exp:channel:next_entry}
    
    {exp:channel:prev_entry }
    Previous entry: <a href="/blog/blog-post/{url_title}">{title}</a>
    {/exp:channel:prev_entry}

    go to this page and add on the last (/entry_id)  replace entry_id with any entry_id exists in your data (I prefer not last entry id)

    If this code return data or the error message disappear please go to step 3
    if not please recheck your data:

    1- check if your url_title exists and check its spelling.
    2- check if your entry_id exists.
    3- check if your channel exists and check its spelling.
    4- check if your entry assigned to the channel u specified in channel parameter.

    and I chcek Next/Previous Entry user guide and there is no url_title=”” parameter, so remove it.

  • #6 / Dec 19, 2011 8:06pm

    khowe

    12 posts

    Okay, to make this even more confusing I tried to apply the simplest version of the tag to 2 other channels to see if it works. And it does. I tried simply removing all additional tags on the channel in question “blog” and it still doesn’t work. I renamed the channel from “blog” to “blog_entrie_abc” as a way to test and still nothing.

    I even removed all additional tags etc and simply displayed the entry title and tried to get previous/next entries and still nothing…

    This is what works for other channels.

    {exp:channel:next_entry}
    Next entry: <a href="/blog/blog-post/{url_title}">{title}</a>
    {/exp:channel:next_entry}
    
    {exp:channel:prev_entry}
    Previous entry: <a href="/blog/blog-post/{url_title}">{title}</a>
    {/exp:channel:prev_entry}

    I am completely lost as to what to try next.

  • #7 / Dec 19, 2011 8:13pm

    khowe

    12 posts

    Okay…so confusing, I just got it working. Not sure what the difference is but here is how the site is set up…

    The blog channel has a template group called blog.group
    Simple index file to embed a template dependent upon the segments in the URL as follows:

    {if segment_3}
     {embed="blog/blog-post"}
    {if:else}
     {embed="blog/blog-listing"}
    {/if}

    So, this page then embeds blog-post.html if there is a segment 3, otherwiswe we get the listing, very straight forward.

    The URL structure is then /blog/post/{url_title}

    Segment 3 tells the index file to embed the right template. EE seems to hate this. If I change my URL structure to /blog/blog-post/{url_title} it bypasses my index file in that template group and uses blog-post.html by default, since that templategroup/file that is in the URL structure exists.

    When it uses the URL structure it works fine. The odd thing is that this same exact structure is used for other channels and it doesn’t work.

    To me this seems to be a fault of EE or is it behaving correctly? If so, why will it work in some channels but not others?

  • #8 / Dec 21, 2011 3:19pm

    Kevin Smith

    4784 posts

    Ah, good to know you’ve narrowed down the problem, khowe! It’s behaving correctly as far as I can tell.

    In your template group “blog”, do you actually have a template called “post”? If not, then EE is loading the index template of that group as the default 404 page. I wouldn’t recommend this. Instead, place the code in your most recent post in a template called ‘post’. You can then set up a redirect from the ‘index’ template to the ‘post’ template of that group.

    Does that help?

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

ExpressionEngine News!

#eecms, #events, #releases