18.4.3 Pagination Links

In Chapter 16: Serving Static Content with Django we created a template block in base_organizer.html for page links in startup_list.html and tag_list.html to override. However, as the code for page links in both of these templates are created by identical code (which features a condition), we can delete both of these displays and move the code into base_organizer.html.

Where the content_footer template block once was (with its surrounding HTML div tags), we now have the code shown in Example 18.14.

Example 18.14: Project Code

organizer/templates/organizer/base_organizer.html in b5a75d8dfb

14    {% if is_paginated %} 15      <div class="row"> 16        <div class="twelve columns"> 17           ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.