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.

prev-next nav not working on main page

September 16, 2009 12:29pm

Subscribe [2]
  • #1 / Sep 16, 2009 12:29pm

    jbcobbs

    53 posts

    I have a a gallery at /gallery/details3 - On the main page of the gallery, it has the most recent image big with thumbnails to the rest of the images. I am trying to have prev/next buttons as well at top. The nav shows on other pages besides the main page but not on the main page.

    {exp:weblog:prev_entry weblog="photo_gallery" category="22"}
    <a href="http://{path=gallery/details3}">{title}</a>
    {/exp:weblog:prev_entry}
    
    {exp:weblog:next_entry weblog="photo_gallery" category="22"}
    <a href="http://{path=gallery/details3}">{title}</a>
    {/exp:weblog:next_entry}
    
    {exp:weblog:entries weblog="photo_gallery" category="22" limit="1"}
    /phpThumb/phpThumb.php?src={photo_image}&w=980&aoe=1&hp=650
    <div id="element_info">
    <li><h1>{title}</h1></li>
    <li>{photo_description}</li>
    </div>
    {/exp:weblog:entries}
  • #2 / Sep 16, 2009 1:46pm

    Genevieve

    52 posts

    I believe the {exp:weblog:prev_entry} and {exp:weblog:next_entry} tags only work on single entry templates(check out the documentation here). For your index (main page), you could try using the pagination links, and specify in your opening {exp:weblog:entries} tag that you want the pagination to display at the top. So your template would look like this:

    {exp:weblog:entries weblog="photo_gallery" category="22" limit="1" pagination="top"}
    
    {paginate}
    
    {if previous_page}
    <a href="http://{auto_path}">Previous Page</a>  
    {/if}
    
    {if next_page}
    <a href="http://{auto_path}">Next Page</a>
    {/if}
    
    {/paginate}
    
    /phpThumb/phpThumb.php?src={photo_image}&w=980&aoe=1&hp=650
    <div id="element_info">
    <li><h1>{title}</h1></li>
    <li>{photo_description}</li>
    </div>
    {/exp:weblog:entries}

    I *think* that will accomplish what you’re going for.

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

ExpressionEngine News!

#eecms, #events, #releases