Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#133 2015-10-17 17:31:00

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

Re: etc_pagination: paginate everything

NicolasGraph wrote #295932:

If I don’t use the root attribute, the pagination links break

That is?

Offline

#134 2015-10-17 17:32:36

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

Re: etc_pagination: paginate everything

etc wrote #295931:

What is output by these tags?

Sorry, it’s /oui_test/articles/smd_tags/periclitanti on each pages.


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

Offline

#135 2015-10-17 17:38:23

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

Re: etc_pagination: paginate everything

etc wrote #295934:

That is?

Yes, for exemple the link to the second page go to http://localhost:8888/oui_test/articles?pg=2
No smd_tags things…


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

Offline

#136 2015-10-17 17:38:58

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

Re: etc_pagination: paginate everything

NicolasGraph wrote #295935:

Sorry, it’s /oui_test/articles/smd_tags/periclitanti on each pages.

Ah, that’s strange. It means <txp:page_url /> looses ?pg=2 query part, which it normally shouldn’t. Could it be that some other plugin rewrites it?

Offline

#137 2015-10-17 17:42:22

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

Re: etc_pagination: paginate everything

etc wrote #295937:

Ah, that’s strange. It means <txp:page_url /> looses ?pg=2 query part, which it normally shouldn’t. Could it be that some other plugin rewrites it?

I disabled other plugins without success.


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

Offline

#138 2015-10-17 17:44:58

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

Re: etc_pagination: paginate everything

You can try to fix it by passing query='pg=<txp:etc_offset type="page" pageby="3" />' to your initial <txp:etc_pagination /> tag. And you actually don’t need adi_calc there, <txp:etc_numpages total='<txp:smd_tag_count wrapcount="" />' pageby="3" /> should do.

Offline

#139 2015-10-17 17:59:32

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

Re: etc_pagination: paginate everything

NicolasGraph wrote #295938:

I disabled other plugins without success.

Have you disabled smd_tags too? Looks like it does some request_uri rewriting.

Offline

#140 2015-10-17 17:59:45

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

Re: etc_pagination: paginate everything

etc wrote #295939:

You can try to fix it by passing query='pg=<txp:etc_offset type="page" pageby="3" />' to your initial <txp:etc_pagination /> tag. And you actually don’t need adi_calc there, <txp:etc_numpages total='<txp:smd_tag_count wrapcount="" />' pageby="3" /> should do.

I can’t get it work, it just adds another other url variable …?pg=1&pg=2 but the problems with or without root are the same. With root, links go to the right pages but pagination always think it is the first page. Without root, links are broken (http://localhost:8888/oui_test/articles?pg=2) but if I go manually the right pages, it detects the current page and current/prev/next links are ok.

Edit: but etc_numpages works fine, thanks.

Last edited by NicolasGraph (2015-10-17 18:00:58)


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

Offline

#141 2015-10-17 18:04:21

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

Re: etc_pagination: paginate everything

etc wrote #295941:

Have you disabled smd_tags too? Looks like it does some request_uri rewriting.

No, I didn’t. Your plugin works fine on section and category pages but what I would like is to get it work with smd_tags so I didn’t disabled it.


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

Offline

#142 2015-10-17 18:27:14

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

Re: etc_pagination: paginate everything

If etc_offset detects the right page, this should work:

<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>'
	query='pg=<txp:etc_offset type="page" />'
/>

I don’t see how it could add a second pg url parameter, sorry.

Offline

#143 2015-10-17 18:35:25

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

Re: etc_pagination: paginate everything

etc wrote #295945:

If etc_offset detects the right page, this should work:

<txp:etc_pagination pages='<txp:variable name="pages" />' pgcounter="pg" range="2" prev='<' next='>'...

I don’t see how it could add a second pg url parameter, sorry.

THANK YOU!
I’ll maybe post on textpattern tips; it could be usefull for anyone else; what do you think?


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

Offline

#144 2015-10-17 18:39:24

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

Re: etc_pagination: paginate everything

You are welcome! And I will think of a more automatic solution for the next version.

Offline

Board footer

Powered by FluxBB