Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#121 2015-09-22 17:04:25

msome
Member
Registered: 2015-09-16
Posts: 32

Re: etc_pagination: paginate everything

Thank you, etc.
It’s work.

Offline

#122 2015-10-17 05:55:03

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 276

Re: etc_pagination: paginate everything

how to have just Next & Previous navigations ?
I’m using jscroll to load articles through ajax, I did the following codes, next button appear but i need to paginate like <txp:older />

<txp:article_custom section="news" offset='<txp:etc_offset pgcounter="page" pageby="3" />' limit="3" pgonly="0" />

<txp:etc_pagination pages='<txp:etc_numpages section="news" limit="3" />' pgcounter="page" range="0" next="More" />

but i need to have just next & prev buttons with assigning a class, like:
<a class="jscroll" href="<txp:older />">More</a>

Offline

#123 2015-10-17 09:44:50

etc
Developer
Registered: 2010-11-11
Posts: 5,013
Website GitHub

Re: etc_pagination: paginate everything

raminrahimi wrote #295892:

i need to have just next & prev buttons with assigning a class, like:
<a class="jscroll" href="<txp:older />">More</a>

Try this:

<txp:etc_pagination pages='<txp:etc_numpages section="news" limit="3" />'
	mask="{prev}{next}" range="0" pgcounter="page"
	prev="<a href='{href}' class='jscroll'>Less</a>"
	next="<a href='{href}' class='jscroll'>More</a>"
/>

Edit: this is probably more future-proof (mask is still experimental):

<txp:etc_pagination pages='<txp:etc_numpages section="news" limit="3" />'
	pgcounter="page" range="0"
	link="" prev="Less" next="More"
>
	<a rel="{rel}" href="{href}" class="jscroll">{link}</a>
</txp:etc_pagination>

Last edited by etc (2015-10-17 10:22:09)

Offline

#124 2015-10-17 14:15:50

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: etc_pagination: paginate everything

Hi,
I’m trying to paginate an smd_tags list page.

<txp:smd_related_tags limit="3" offset='<txp:etc_offset pgcounter="pg" pageby="3" />' />

<txp:variable name="pages">
    <txp:adi_calc value='<txp:smd_tag_count wrapcount="" />' divide="3" />
</txp:variable>

<txp:etc_pagination pages='<txp:variable name="pages" />' pgcounter="pg" range="2" prev='<' next='>' root='<txp:page_url />/smd_tags/<txp:smd_tag_list wraptag="" break=""><txp:smd_tag_info /></txp:smd_tag_list>' />

The code above generate the pagination and each page is ok but the pagination is always showing the links like if I am on the first page. It seems it can’t get the pagecounter parameter…

Something I forgot or don’t see?


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#125 2015-10-17 15:05:48

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: etc_pagination: paginate everything

Hi Nicolas, I’ve had a real bad headscratching with declaring a variable the way you’re doing it above, maybe that’s all. Try removing tabs/spaces/returns from inside the declaring variable tag and reduce it to

<txp:variable name="pages"><txp:adi_calc value='<txp:smd_tag_count wrapcount="" />' divide="3" /></txp:variable>

In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#126 2015-10-17 15:16:56

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: etc_pagination: paginate everything

uli wrote #295922:

Hi Nicolas, I’ve had a real bad headscratching with declaring a variable the way you’re doing it above, maybe that’s all. Try removing tabs/spaces/returns from inside the declaring variable tag and reduce it to

<txp:variable name="pages"><txp:adi_calc value='<txp:smd_tag_count wrapcount="" />' divide="3" /></txp:variable>...

In fact I just put tabs/spaces/returns here for clarity but there are not in my code and the pages variable seems to be ok because I have the good page count. The problem is with pagecounter I think.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#127 2015-10-17 15:45:12

etc
Developer
Registered: 2010-11-11
Posts: 5,013
Website GitHub

Re: etc_pagination: paginate everything

Hi,

I’m not sure about

root='<txp:page_url />/smd_tags/<txp:smd_tag_list wraptag="" break=""><txp:smd_tag_info /></txp:smd_tag_list>'

On the second page it becomes

root='.../smd_tags/smd_info?pg=2/smd_tags/smd_info'

and etc_pagination thinks it’s on the page 2/smd_tags/smd_info. What if you simply remove root attribute, or try

root='<txp:site_url />smd_tags/<txp:smd_tag_list wraptag="" break=""><txp:smd_tag_info /></txp:smd_tag_list>'

Edit: remove / after <txp:site_url />.

Last edited by etc (2015-10-17 15:50:43)

Offline

#128 2015-10-17 16:02:44

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: etc_pagination: paginate everything

etc wrote #295925:

What if you simply remove root attribute, or try…

It does not work, but it is maybe because of my site structure…

Anyways, I don’t really understand what you mean about the smd_tags url…
On my side, with

root='<txp:page_url />/smd_tags/article/<txp:smd_tag_list wraptag="" break=""><txp:smd_tag_info /></txp:smd_tag_list>'@

the tag url

http://localhost:8888/oui_test/articles/smd_tags/article/periclitanti 

becomes

http://localhost:8888/oui_test/articles/smd_tags/article/periclitanti?pg=2

Nothing wrong… (?)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#129 2015-10-17 16:08:11

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: etc_pagination: paginate everything

Moreover, <txp:etc_offset pgcounter="pg" type="page" pageby="3" /> gives me the right values on each pages, so I don’t understand why the current link is always the first page and the next link the second one.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#130 2015-10-17 17:01:03

etc
Developer
Registered: 2010-11-11
Posts: 5,013
Website GitHub

Re: etc_pagination: paginate everything

Try to output

<txp:page_url />/smd_tags/<txp:smd_tag_list wraptag="" break=""><txp:smd_tag_info /></txp:smd_tag_list>

on your pages 2, 3 and so on. That’s what etc_pagination thinks the current url is.

Offline

#131 2015-10-17 17:21:58

etc
Developer
Registered: 2010-11-11
Posts: 5,013
Website GitHub

Re: etc_pagination: paginate everything

NicolasGraph wrote #295930:

neither… :-/

What is output by these tags? Is it

http://localhost:8888/oui_test/articles/smd_tags/article/periclitanti?pg=2/smd_tags/article/periclitanti

Offline

#132 2015-10-17 17:29:40

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: etc_pagination: paginate everything

I found something (‘don’t already know what does it mean).
If I don’t use the root attribute, the pagination links break but the current/prev/next links are ok on each pages when I go manually.

Last edited by NicolasGraph (2015-10-17 17:30:35)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

Board footer

Powered by FluxBB