Skip to content

Commit be2d343

Browse files
committed
Further work on core pagination solution
1 parent 1dfd637 commit be2d343

File tree

5 files changed

+19
-40
lines changed

5 files changed

+19
-40
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ For example:
102102

103103
All plugins we use are installed via Composer:
104104

105-
* [`etc_pagination`](https://github.com/etc-plugins/etc_pagination) ✓ Composer
106105
* [`pat_if_amp`](https://github.com/cara-tm/pat_if_amp) ✓ Composer
107106
* [`rah_comment_spam`](https://github.com/gocom/rah_comment_spam) ✓ Composer
108107
* [`smd_thumbnail`](https://github.com/bloke/smd_thumbnail) ✓ Composer

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"textpattern/installer": "1.0.10",
99
"bloke/smd_thumbnail": "0.4.0-beta",
1010
"cara-tm/pat_if_amp": "0.3.7",
11-
"etc-plugins/etc_pagination": "0.5.0",
1211
"rah/rah_comment_spam": "0.9.0"
1312
}
1413
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<txp:pages pg="pg" evaluate="5,2,8,4,6">
2+
<nav class="paginator" aria-label="Blog navigation">
3+
Pages:
4+
<txp:newer showalways link=""><a rel="prev" href="<txp:yield item="url" />" title="Go to previous page" aria-label="Go to previous page">Previous</a></txp:newer>
5+
<ul class="pagination">
6+
<txp:newer shift link=""><li><a href="<txp:yield item="url" />" title="Go to page <txp:yield item="page" />" aria-label="Go to page <txp:yield item="page" />"><txp:yield item="page" /></a></li></txp:newer>
7+
<txp:evaluate test="newer"><txp:newer shift="-2" link=""><li role="separator" title="More pages" aria-label="More pages">…</li></txp:newer></txp:evaluate>
8+
<txp:newer total shift="2" link=""><li><a href="<txp:yield item="url" />" title="Go to page <txp:yield item="page" />" aria-label="Go to page <txp:yield item="page" />"><txp:yield item="page" /></a></li></txp:newer>
9+
<txp:newer shift="0" link=""><li class="current"><b title="Current page" aria-current="page"><txp:yield item="page" /></b></li></txp:newer>
10+
<txp:older total shift="2" link=""><li><a href="<txp:yield item="url" />" title="Go to page <txp:yield item="page" />" aria-label="Go to page <txp:yield item="page" />"><txp:yield item="page" /></a></li></txp:older>
11+
<txp:evaluate test="older"><txp:older shift="-2" link=""><li role="separator" title="More pages" aria-label="More pages">…</li></txp:older></txp:evaluate>
12+
<txp:older shift link=""><li><a href="<txp:yield item="url" />" title="Go to page <txp:yield item="page" /> (last page)" aria-label="Go to page <txp:yield item="page" /> (last page)"><txp:yield item="page" /></a></li></txp:older>
13+
</ul>
14+
<txp:older showalways link=""><a rel="next" href="<txp:yield item="url" />" title="Go to next page" aria-label="Go to next page">Next</a></txp:older>
15+
</nav>
16+
</txp:pages>

src/templates/pages/blog.txp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,7 @@
121121
<txp:if_article_list>
122122
<div class="layout-4col-3span">
123123
<txp:article form="article_listing_blog" limit="12" />
124-
<txp:pages pg="pg" evaluate="5,2,8,4,6">
125-
<nav class="paginator" aria-label="Blog navigation">
126-
Pages:
127-
<txp:newer showalways link=""><a rel="prev" href="<txp:yield item="url" />" title="Go to previous page" aria-label="Go to previous page">Previous</a></txp:newer>
128-
<ul class="pagination">
129-
<txp:newer shift link=""><li><a href="<txp:yield item="url" />" title="Go to page <txp:yield item="page" />" aria-label="Go to page <txp:yield item="page" />"><txp:yield item="page" /></a></li></txp:newer>
130-
<txp:evaluate test="newer"><txp:newer shift="-2" link=""><li role="separator" title="More pages" aria-label="More pages">…</li></txp:newer></txp:evaluate>
131-
<txp:newer total shift="2" link=""><li><a href="<txp:yield item="url" />" title="Go to page <txp:yield item="page" />" aria-label="Go to page <txp:yield item="page" />"><txp:yield item="page" /></a></li></txp:newer>
132-
<txp:newer shift="0" link=""><li class="current"><b title="Current page" aria-current="page"><txp:yield item="page" /></b></li></txp:newer>
133-
<txp:older total shift="2" link=""><li><a href="<txp:yield item="url" />" title="Go to page <txp:yield item="page" />" aria-label="Go to page <txp:yield item="page" />"><txp:yield item="page" /></a></li></txp:older>
134-
<txp:evaluate test="older"><txp:older shift="-2" link=""><li role="separator" title="More pages" aria-label="More pages">…</li></txp:older></txp:evaluate>
135-
<txp:older shift link=""><li><a href="<txp:yield item="url" />" title="Go to page <txp:yield item="page" /> (last page)" aria-label="Go to page <txp:yield item="page" /> (last page)"><txp:yield item="page" /></a></li></txp:older>
136-
</ul>
137-
<txp:older showalways link=""><a rel="next" href="<txp:yield item="url" />" title="Go to next page" aria-label="Go to next page">Next</a></txp:older>
138-
</nav>
139-
</txp:pages>
124+
<txp:output_form form="pagination" />
140125
</div>
141126
<txp:else />
142127
<txp:article form="blog" />

src/templates/pages/default.txp

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -271,17 +271,7 @@ foreach ($json->topic as $topic) {
271271
<div class="teaser-container">
272272
<txp:article searchform="article_listing" limit="12" />
273273
</div>
274-
<txp:evaluate test>
275-
<nav class="paginator" aria-label="Page navigation">
276-
Pages:
277-
<txp:etc_pagination range="3"
278-
prev='<a rel="prev" href="{href}" title="Go to previous page" aria-label="Go to previous page">Previous</a>'
279-
next='<a rel="next" href="{href}" title="Go to next page" aria-label="Go to next page">Next</a>'
280-
link='<li><a href="{href}" title="Go to page {*}" aria-label="Go to page {*}">{*}</a></li>,<li class="current"><b title="Current page" aria-current="page">{*}</b></li>'
281-
gap='<li role="separator" title="More pages" aria-label="More pages">…</li>'
282-
mask='{prev}<ul class="pagination">{first}{<+}{links}{+>}{last}</ul>{next}' />
283-
</nav>
284-
</txp:evaluate>
274+
<txp:output_form form="pagination" />
285275
<txp:else />
286276
<div class="article-description" itemprop="description">
287277
<txp:if_search_results>
@@ -311,17 +301,7 @@ foreach ($json->topic as $topic) {
311301
<div class="teaser-container">
312302
<txp:article form="article_listing_blog" limit="12" />
313303
</div>
314-
<txp:evaluate test>
315-
<nav class="paginator" aria-label="Blog navigation">
316-
Pages:
317-
<txp:etc_pagination range="3"
318-
prev='<a rel="prev" href="{href}" title="Go to previous page" aria-label="Go to previous page">Previous</a>'
319-
next='<a rel="next" href="{href}" title="Go to next page" aria-label="Go to next page">Next</a>'
320-
link='<li><a href="{href}" title="Go to page {*}" aria-label="Go to page {*}">{*}</a></li>,<li class="current"><b title="Current page" aria-current="page">{*}</b></li>'
321-
gap='<li role="separator" title="More pages" aria-label="More pages">…</li>'
322-
mask='{prev}<ul class="pagination">{first}{<+}{links}{+>}{last}</ul>{next}' />
323-
</nav>
324-
</txp:evaluate>
304+
<txp:output_form form="pagination" />
325305
</div>
326306
<txp:output_form form="sidebar" />
327307
</div>

0 commit comments

Comments
 (0)