{% if maxPages is defined and maxPages > 1 %} <div id="pagination"> <a href="{{ path(currentPath, {'pageType':pageType, page: thisPage, 'topic':topic} ) }}">{{ thisPage }}</a> {% if thisPage != maxPages %} <a href="{{ path( currentPath, {'pageType':pageType, page: thisPage+1 <= maxPages ? thisPage+1 : thisPage, 'topic':topic} + templateVars) }}" class="next">ยป</a> {% endif %} </div>{% else %} {% set maxPages = 100 %}{% endif %}