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/Previous not displaying on a single-entry page.

April 28, 2011 7:56pm

Subscribe [2]
  • #1 / Apr 28, 2011 7:56pm

    Kurt Deutscher

    827 posts

    I’m stumped.

    Its been a while since I added this to a site, but don’t remember having this issue before.

    {exp:channel:next_entry channel="{embed:host_language_channel_name}" category="{embed:cat_id}"}
        next entry: <a href="http://{path=site/comments}">{title}</a> »
    {/exp:channel:next_entry}
    
    channel="{embed:host_language_channel_name}" category="{embed:cat_id}" entry_id="{segment_4}"
    
    {exp:channel:prev_entry channel="galleries" category="11"}
        « previous image: <a href="http://{path=site/comments}">{title}</a>
    {/exp:channel:prev_entry}

    I have some check-code in the middle of the two tag-pairs to make sure that all the info the tags should need are available within the template they are in.

    I’m wondering if EE is checking segment_3 for the entry_id and if that’s why it’s not working? In our site, the entry_id is in segment_4, but it is the last segment of the URI, so I would hope EE could handle that.

    The tags are outside of a channel tag.

    I’ve even hard-coded the channel and category and that’s not helped.

    v2.1.4 - Build:  20110411

  • #2 / Apr 29, 2011 3:25pm

    Sue Crocker

    26054 posts

    Hi, Kurt.

    Can you tell us what the url looks like: In other words, what is in segment_3?

    The next step would be to create a new single entry template and hard code the values you have now as embeds..

  • #3 / Apr 29, 2011 4:22pm

    Kurt Deutscher

    827 posts

    Hi Sue,

    I’ve already tried the “next-step” you mention…. and its not liking it.

    Here’s a URI:

    index.php/galleries/iraq/baghdad-portrait-studio/36/

    Here’s what you’re looking at:

    site_index/template_group/category_url_title/entry_url_title/entry_id/

    I know EE would typically be expecting something a little different, but with the ID still in the last segment, I sort of thought this would still work.

    If we used the category_indicator in a segment, that would push the entry ID out to segment_4 wouldn’t it? (I’ve never actually used it, but my understanding of it is that it would).

  • #4 / May 02, 2011 4:57pm

    Lisa Wess

    20502 posts

    Hi, Kurt,

    EE looks for the entry_id or url_title in segment_2 or segment_3; not in the last segment.  So yes, what you’re seeing is expected behavior.  It’s one of the difficulties with “rolling your own” for the URLs at this point in time.

  • #5 / May 02, 2011 6:46pm

    Kurt Deutscher

    827 posts

    Hi Lisa,

    Thanks for the confirmation.

    We have the entry’s url_title in segment_3, so something else we’re doing must be tripping up EE. Guess I’ll get to write a custom query or two for this, or maybe there’s an add-on… I’ll look around.

    Having you confirm that this is expected behavior (and not a bug or something) is most helpful because I’ll stop trying to make it work. ;~D

    Have a great week!

  • #6 / May 02, 2011 11:24pm

    Marcus Neto

    1005 posts

    Thanks Kurt. 😉 I’m going to close this thread but don’t hesitate to drop us a line if something else comes up.

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

ExpressionEngine News!

#eecms, #events, #releases