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 Entry Linking

March 12, 2009 2:57am

Subscribe [4]
  • #1 / Mar 12, 2009 2:57am

    Benjamin Katz

    20 posts

    Hello…

    I’m using the {exp:weblog:next_entry} and {exp:weblog:prev_entry} tags to add some pagination to my site.  When you’re at the last entry, the next_entry tag doesn’t output anything.  I would like to display a disabled “next” button instead.  How would I do this?

    Is there a conditional within the next_entry tag that I could use?  Something like the {if no_results} functionality of the weblog:entries tag?  Or is there some other way to do this?

  • #2 / Mar 12, 2009 9:06am

    futuristonline

    43 posts

    I am having the same problem - can anyone help?

    Thanks

    Steve

  • #3 / Mar 12, 2009 11:35am

    Benjamin Katz

    20 posts

    Hey Steve…

    I was able to work around this.  I just tested for the {title} variable inside the {exp:weblog:next_entry} loop .  If it’s blank we know that there is no output so you can put your disabled button in there.

    {exp:weblog:next_entry}
      {if title == ""} No results{/if}
      The next entry is {title}.
    {/exp:weblog:next_entry}

    There should be a way to do this natively though.  I’ll add a feature request later, perhaps.

  • #4 / Mar 12, 2009 11:39am

    Benjamin Katz

    20 posts

    Spoke too soon…that doesn’t really work.  I should have tested that before I posted.  Sorry 😊

  • #5 / Mar 12, 2009 11:51am

    Benjamin Katz

    20 posts

    There is a workaround here.

  • #6 / Mar 12, 2009 11:56am

    futuristonline

    43 posts

    Yeah - its a bit iffy doing it through PHP. I think I would just rather stick a “back to news” links in and do it that way - its neater.

    Thanks for your help Benjamin

    Steve

  • #7 / Jun 02, 2010 9:53am

    vladyn

    176 posts

    I’ve general problem with displaying any output from this tag ..
    I have :

    {if:elseif segment_4 != ''}
    {exp:weblog:entries weblog="work" limit="1" url_title="{segment_4}"}
        <div id="slideshow">    
          <span>Loading</span>
          <ul id="pictures">
        {project_images}
            <li>{exp:imgsizer:size image="{file_url}" width="672" alt="{title}"}</li>
        {/project_images}
          </ul>
          <ul id="menu">
        {project_images}    
            <li><a href="http://{file_url}">Page {count}</a></li>
        {/project_images}
          </ul>
    <!-- corners -->
            <div id="top_left" class="corner"></div>
            <div id="top_right" class="corner"></div>
            <div id="bottom_left" class="corner"></div>
            <div id="bottom_right" class="corner"></div>
        </div>
        {embed="includes/.share"}
        <h2>{title}</h2>
    <p>    <h3 class="project_type">{kind}</h3><br />
        {project_description}<br />
    {/exp:weblog:entries}<br />
        <div id="prev-next"><br />
            {exp:weblog:next_entry weblog="work" category="{segment_3_category_id}"}<br />
            <a href="http://{path=">previous {title}</a><br />
            {/exp:weblog:next_entry}<br />
            {exp:weblog:prev_entry weblog="work" category="{segment_3_category_id}"}<br />
            <a href="http://{path=">next:// {title}</a><br />
            {/exp:weblog:prev_entry}<br />
        </div>    <br />
    {/if}

    my URL structure - seg1 - template group
    seg2 - category
    seg3 - category_url_title
    seg4 - url_title

    What I’m doing wrong? Can anyone help?

  • #8 / Jul 06, 2010 6:21am

    YuanYuan

    1 posts

    I’ve general problem with displaying any output from this tag ..
    I have :

    {if:elseif segment_4 != ''}
    {exp:weblog:entries weblog="work" limit="1" url_title="{segment_4}"}
        <div id="slideshow">    
          <span>Loading</span>
          <ul id="pictures">
    ............

    I have the same problem…

    anyone have good soultion ?

    thanks.

  • #9 / Jul 06, 2010 6:25am

    vladyn

    176 posts

    yeah I’m still not solved this as well

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

ExpressionEngine News!

#eecms, #events, #releases