Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#157 2015-10-21 15:26:02
Re: etc_pagination: paginate everything
Before releasing the next version, I want to put the “gaps” to contribution. Currently, they are just visual indicators, like this:
1 2 3 4 5 ... 100
The idea is to transform them into links to some intermediate value:
1 2 3 4 5 10 100
This value (10
above) can be chosen closer to the main range (1 2 3 4 5
) or to the last link (100
) following some numeric attribute. I need a clever name for this attribute: scale, drift, any ideas?
Online
#158 2015-10-21 15:30:08
Re: etc_pagination: paginate everything
scale
sounds fine to me, in this sense.
Offline
#159 2015-10-21 15:38:48
Re: etc_pagination: paginate everything
Thanks, Phil. Then which value of scale
looks more natural for the linear scale (would give a link to page 53 = (5+100)/2
here): 0
or 1
?
Online
#160 2015-10-25 05:40:35
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
Re: etc_pagination: paginate everything
could you please help me how to make etc_pagination to paginate through ajax ?
i mean all the pagination should work without reloading the page.
thanks
Offline
#161 2015-10-25 13:17:13
Online
#162 2015-10-25 19:08:53
Online
#163 2015-10-27 08:05:52
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
Re: etc_pagination: paginate everything
etc wrote #296188:
Sorry, I don’t understand, isn’t that what you have done here?
That was jscroll all the paginated pages was appending to one page that was solved :-) but now i want to just paginate the specific area using ajax.
following example paginating and reloading whole page, but need to paginate through ajax
<div id="recent" class="recent">
<txp:article_custom section="news" limit="3" offset='<txp:etc_offset pgcounter="page" pageby="3" />' pgonly="0">
<txp:title />
</txp:article_custom>
</div>
<txp:etc_pagination pages='<txp:etc_numpages section="news" limit="3" />'
mask="{prev}{next}" range="0" pgcounter="page"
prev="<a href='{href}' class='jscroll'>Prev</a>"
next="<a href='{href}' class='jscroll'>Next</a>"
/>
Offline
#164 2015-10-27 10:34:26
Re: etc_pagination: paginate everything
So, you need to replace instead of append? If so, try this (include jQuery first):
<div id="wrapper">
<div id="recent" class="recent">
<txp:article_custom section="news" limit="3" offset='<txp:etc_offset pgcounter="page" pageby="3" />' pgonly="0">
<txp:title />
</txp:article_custom>
</div>
<txp:etc_pagination pages='<txp:etc_numpages section="news" limit="3" />'
mask="{prev}{next}" range="0" pgcounter="page"
prev="<a href='{href}' class='jscroll'>Prev</a>"
next="<a href='{href}' class='jscroll'>Next</a>"
/>
</div>
<script>
$(function () {
$("#wrapper").on("click","a.jscroll",function(event) {
event.preventDefault();
$("#wrapper").load($(this).attr("href")+" #wrapper>*");
});
});
</script>
Online
#165 2015-10-28 16:48:19
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
Re: etc_pagination: paginate everything
Aha thanks ETC ! that’s great, works fine for me :-)
if i want to have all the navigations as well like 1, 2, 3…. what to do ?
Last edited by raminrahimi (2015-10-28 17:00:45)
Offline
#166 2016-04-06 13:38:46
Re: etc_pagination: paginate everything
Can someone help me. I’m implementing ‘Foundation” to create a responsive website. Foundation has some handy ready to use css styles for pagination, however, there require additional codes to be added to the <a> links. I can’t figure out if, and if so, how this can be done with etc_pagination.
See http://foundation.zurb.com/sites/docs/pagination.html for examples
I would like to simply use the example tag provided in the help file: <txp:etc_pagination range=“2” prev=“Previous” next=“Next” wraptag=“ul” break=“li” />
Adding [ atts=’“pagination” role=“navigation” aria-label=“Pagination”’ ] takes care of the Foundation-required code in the UL but I can’t figure out how I can get the required additional code in the <a> links to make it work.
Anyone has any suggestions?
Alternatively, is it possible to add a class=“whatever” tag to the <a> links generated by etc_pagination. Currently I have know idea how to style them, as <span> doesn’t seem to work in combination with Foundation.
Last edited by Karsten (2016-04-06 13:40:32)
Offline
#167 2016-04-06 13:43:23
Offline
#168 2016-04-07 12:37:38
Re: etc_pagination: paginate everything
Karsten wrote #298526:
Anyone has any suggestions?
What is your suggestion? Things would be easier if etc_pagination
were always supposed to generate <a>
tags, but this would exclude, say, <select>
link construction on the plugin’s page. Maybe, this is the way to go, though I’d rather prefer etc_pagination
generate only page numbers/hrefs/rels and leave all wrapping to users. Currently, it is somewhere in between.
Alternatively, is it possible to add a class=“whatever” tag to the <a> links generated by etc_pagination.
Yes, etc_query can totally alter any markup, try
<txp:etc_query data='<txp:etc_pagination />' replace="//a@@class=whatever@aria-label=whatelse" />
Online