Skip to content

Commit

Permalink
Merge pull request #178 from MightyM17/pageinator-search
Browse files Browse the repository at this point in the history
Fix paginator on blog page with search
  • Loading branch information
Noelierx authored Oct 25, 2023
2 parents 4b4bd5d + 96793a9 commit 888b5fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions templates/views/blog/_pagination.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<div class="navigation">
<ul class="pagination">
{% if paginator.hasPreviousPage %}
<li class="prev arrow"><a href="{{ path('blog_paginated', {page: paginator.previousPage, author: author, tag: app.request.get('tag')}) }}" rel="previous"><i class="fa fw fa-chevron-left"></i></a></li>
<li class="prev arrow"><a href="{{ path('blog_paginated', {page: paginator.previousPage, author: author, tag: app.request.get('tag'), query: app.request.get('query')}) }}" rel="previous"><i class="fa fw fa-chevron-left"></i></a></li>
{% endif %}

{% for i in 1..paginator.lastPage %}
{% if i == paginator.currentPage %}
<li class="active"><a>{{ i }}</a></li>
{% else %}
<li><a href="{{ path('blog_paginated', {page: i, author: author, tag: app.request.get('tag')}) }}">{{ i }}</a></li>
<li><a href="{{ path('blog_paginated', {page: i, author: author, tag: app.request.get('tag'), query: app.request.get('query') }) }}">{{ i }}</a></li>
{% endif %}
{% endfor %}

{% if paginator.hasNextPage %}
<li class="next arrow"><a href="{{ path('blog_paginated', {page: paginator.nextPage, author: author, tag: app.request.get('tag')}) }}" rel="next"><i class="fa fw fa-chevron-right"></i></a></li>
<li class="next arrow"><a href="{{ path('blog_paginated', {page: paginator.nextPage, author: author, tag: app.request.get('tag'), query: app.request.get('query') }) }}" rel="next"><i class="fa fw fa-chevron-right"></i></a></li>
{% endif %}
</ul>
</div>
Expand Down

0 comments on commit 888b5fc

Please sign in to comment.