Skip to content

Commit

Permalink
Merge branch 'release/1.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Aug 29, 2018
2 parents 5f6b506 + 6a0dc17 commit 24acdc4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v1.4.1
## 08/28/2018

1. [](#bugfix)
* Reverted Twig fix to address broken `url` in Twig [#34](https://github.com/getgrav/grav-plugin-pagination/issues/34)
* Removed duplicate README text [#30](https://github.com/getgrav/grav-plugin-pagination/issues/30)

# v1.4.0
## 08/20/2018

Expand Down
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,6 @@ The above example is taken from http://ami-web.nl/events. This code creates a pa

### Rendering the paginated collection

The rest is identical to the standard procedure.

```twig
{% set collection = page.find('/other/_events').children %}
{% set limit = 5 %}
{% set ignore_url_param_array = ['event'] %}
{% do paginate(collection, limit, ignore_url_param_array) %}
```

The above example is taken from http://ami-web.nl/events. This code creates a paginated collection with 5 items per page (the event summary list) which is presented together with an active event. The active event appears in only one of the summary pages. Consequently, the url parameter `event` should be filtered out so it does not show up in the pagination bar's links, preventing inconsistencies with different page parameters. Any non listed url parameters (except the page parameter) are passed through unaffected. The requested page contains logic to pick a sensible default event.

## Rendering the paginated collection

The rest is identical to the standard procedure:

```twig
Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Pagination
version: 1.4.0
version: 1.4.1
description: "**Pagination** is a very useful plugin to help navigate a large collection of pages, such as for a **blog**."
icon: list-ol
author:
Expand Down
6 changes: 3 additions & 3 deletions templates/partials/pagination.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<ul class="pagination">
{% if pagination.hasPrev %}
{% set url = base_url ~ (pagination.params ~ pagination.prevUrl)|replace({'//':'/'}) %}
{% set url = (base_url ~ pagination.params ~ pagination.prevUrl)|replace({'//':'/'}) %}
<li><a rel="prev" href="{{ url }}">&laquo;</a></li>
{% else %}
<li><span>&laquo;</span></li>
Expand All @@ -16,15 +16,15 @@
{% if paginate.isCurrent %}
<li><span>{{ paginate.number }}</span></li>
{% elseif paginate.isInDelta %}
{% set url = base_url ~ (pagination.params ~ paginate.url)|replace({'//':'/'}) %}
{% set url = (base_url ~ pagination.params ~ paginate.url)|replace({'//':'/'}) %}
<li><a href="{{ url }}">{{ paginate.number }}</a></li>
{% elseif paginate.isDeltaBorder %}
<li class="gap"><span>&hellip;</span></li>
{% endif %}

{% endfor %}
{% if pagination.hasNext %}
{% set url = base_url ~ (pagination.params ~ pagination.nextUrl)|replace({'//':'/'}) %}
{% set url = (base_url ~ pagination.params ~ pagination.nextUrl)|replace({'//':'/'}) %}
<li><a rel="next" href="{{ url }}">&raquo;</a></li>
{% else %}
<li><span>&raquo;</span></li>
Expand Down

0 comments on commit 24acdc4

Please sign in to comment.