Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#151 2015-10-18 12:26:44
Offline
#152 2015-10-18 12:27:58
Re: etc_pagination: paginate everything
I wrote to Jakob because he asked for stef to help him to get smd_tags and etc_pagination work together.
Maybe he found something simpler than what I’m using for now…
Edit: I sent him the new solution.
Last edited by NicolasGraph (2015-10-18 12:38:43)
Offline
#153 2015-10-18 12:31:20
Offline
#154 2015-10-18 13:15:42
Re: etc_pagination: paginate everything
NicolasGraph wrote #295971:
Let me call you Boss for today Oleg!
And then claim some extras for Sunday work? :) Thanks for testing, helped me much. The story is that smd_tags rewrites $_SERVER['REQUEST_URI'], removing the /smd_tag part, so etc_pagination gets a shorten url. The new version loads before smd_tags and stores the true url before some other plugin modifies it.
Offline
#155 2015-10-18 13:42:19
Offline
#156 2015-10-18 13:56:53
Re: etc_pagination: paginate everything
NicolasGraph wrote #295970:
I wrote to Jakob … Maybe he found something simpler than what I’m using for now … Edit: I sent him the new solution.
Thank you for alerting me. Looking back over my code, it seems I sidestepped the problem by a) calculating the total pages manually (i.e. outside of etc_pagination) from the total-number-of-matched-tagged-articles / number-per-page and plugging that into the pages attribute, and b) using pgcounter="page" instead of pg.
When I get some time, I’ll check out the new version of etc_pagination.
TXP Builders – finely-crafted code, design and txp
Offline
#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?
Offline
#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?
Offline
#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
Offline
#162 2015-10-25 19:08:53
Offline
#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>
Offline
#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