A Better Pagination Template for ExpressionEngine
When you want to use the Next Page / Previous Page pagination in ExpressionEngine, there is no option to display a disabled button when you are at the first or last article in the current channel. The template below is a workaround for this problem.
{paginate}
<div id="pagination">
<ul>
{if "{current_page}" == 1}
<li><span id="prev-disabled">Previous Page</span></li>
{/if}
{if previous_page}
<li><a href="{auto_path}" id="prev">Previous Page</a></li>
{/if}
{if "{current_page}" == "{total_pages}"}
<li><span id="next-disabled">Next Page</span></li>
{/if}
{if next_page}
<li><a href="{auto_path}" id="next">Next Page</a></li>
{/if}
</ul>
</div>
{/paginate}
Browse Articles
Comments (1)
From:Sean
Date:22.12.2010
This is very helpful, thanks! Much nicer than having the previous and next links shift position.
Commenting is closed for this article.
Commenting is not available in this channel entry.
Popular Articles
- Introduction to openFrameworks
- Creating 3D Shapes with Hemesh
- Mirroring Video with openFrameworks
- An Introduction to colorLib
- How to create a FullScreen iPhone Application
Popular Tags
- processing (95)
- software (50)
- art (48)
- web design (40)
- photography (39)