Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: etc_pagination: paginate everything
NicolasGraph wrote:
the problem is the same with
<a href="?pg=3">#</a>
. It means that it doesn’t come from the plugin, isn’t it?
Definitely, that’s nothing to do with etc_pagination
.
I tried to pass root=’<txp:page_url />’ to
etc_pagination
but the result ishttp://localhost:8888/en/mywebsite/?pg=3
instead ofhttp://localhost:8888/mywebsite/en/?pg=3
.
That probably means that MLP or the server redirects /mywebsite/en/
to /en/mywebsite/
, but it’s only a guess. You could try to pass
root='<txp:php>echo preg_replace("|/([^/]+)/mywebsite/|", "/mywebsite/$1/", page_url(array()));</txp:php>'
to etc_pagination
to check if we are moving in the right direction.
I wonder if a plugin could know how the page was redirected?
Offline
Re: etc_pagination: paginate everything
Thanks, unfortunatly it doesn’t work, but as you told: nothing to do with your work.
I’m hoping that it comes from Mamp and will be ok online…
Edit: Everything is fine online! Moving on MLP support
Last edited by NicolasGraph (2013-11-12 17:28:55)
Offline
Re: etc_pagination: paginate everything
Can anybody provide an example page showing etc_pagination being used?
When searching a site, will search results take you the right page of a paginated article?
Last edited by towndock (2013-11-01 16:54:06)
Offline
Re: etc_pagination: paginate everything
towndock wrote:
Can anybody provide an example page showing etc_pagination being used?
When searching a site, will search results take you the right page of a paginated article?
If you mean “will search results be paginated”, then yes, they will. I can not show it on my own site, because it uses etc_search
for search results, but you can see it in action here. There is no search form, you have to manually add ?q=your_search_term
to the url.
Offline
Re: etc_pagination: paginate everything
NicolasGraph wrote:
I tried to pass root=’<txp:page_url />’ to
etc_pagination
but the result ishttp://localhost:8888/en/mywebsite/?pg=3
instead ofhttp://localhost:8888/mywebsite/en/?pg=3
.
The latest MLP master seems to work with <txp:etc_pagination root='<txp:site_url />' />
, can you test it?
Offline
Re: etc_pagination: paginate everything
Where did I find the <txp:page_url />
tag? Does it exist?
I’m thinking that I wanted to say <txp:site_url />
…
Anyway, I disabled your plugin online but on Mamp it does not add the lang path with <txp:site_url />
…
Last edited by NicolasGraph (2013-11-13 15:36:57)
Offline
Re: etc_pagination: paginate everything
NicolasGraph wrote:
Where did I find the
<txp:page_url />
tag? Does it exist?
Yes, but doesn’t work. But <txp:etc_pagination root='<txp:site_url />' />
produces http://localhost/textpattern-4.5.5/fr/?pg=3
links for me, is it right? I have installed the master MLP today.
Offline
Re: etc_pagination: paginate everything
On my local site <txp:etc_pagination root='<txp:site_url />' />
seems to produce something like http://localhost/textpattern-4.5.5/?pg=3
Sorry, I’m unable to test it online for now but I’ll try and let you know.
Offline
Re: etc_pagination: paginate everything
Hi Oleg, I tried your plugin online on a fresh install.
You’re right, <txp:etc_pagination root='<txp:site_url />' />
produces http://localhost/textpattern-4.5.5/fr/?pg=2
but if you’re visiting a section page, it won’t add the section variable to the url. It will continue to produce http://localhost/textpattern-4.5.5/fr/?pg=2
instead of http://localhost/textpattern-4.5.5/fr/articles?pg=2
.
Edit: Actually not really a problem as it works with <txp:etc_pagination root='<txp:site_url /><txp:section />' />
.
or <txp:etc_pagination root='<txp:site_url /><txp:if_section><txp:section /></txp:if_section>' />
, etc.
Last edited by NicolasGraph (2013-11-14 13:16:37)
Offline
Re: etc_pagination: paginate everything
Hi Nicolas, thank you for the confirmation.
NicolasGraph wrote:
if you’re visiting a section page, it won’t add the section variable to the url. It will continue to produce
http://localhost/textpattern-4.5.5/fr/?pg=2
instead ofhttp://localhost/textpattern-4.5.5/fr/articles?pg=2
.
That’s normal, since the root
is the same. That’s also why I hoped <txp:page_url />
would do, but MLP transforms it into something unusable.
Actually not really a problem as it works with
<txp:etc_pagination root='<txp:site_url /><txp:section />' />
.
or<txp:etc_pagination root='<txp:site_url /><txp:if_section><txp:section /></txp:if_section>' />
, etc.
Interesting. Does MLP simply injects lang
part into urls?.. let’s see…
Edit: root='<txp:php>echo PROTOCOL.serverSet('HTTP_HOST');</txp:php><txp:page_url />'
seems to work, but isn’t there a better way to get the full page url?
Last edited by etc (2013-11-14 14:11:07)
Offline
Re: etc_pagination: paginate everything
Oh!?
root='<txp:page_url />'
seems to work!
Edit: for me it was only a Mamp problem I think. I haven’t tried to set root='<txp:page_url />'
again when I moved online. It now works like a charm with every listing (front page, section, author, etc.). Let me know if you want to take a look online!
Last edited by NicolasGraph (2013-11-14 15:37:31)
Offline
#60 2013-11-22 08:41:50
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
Re: etc_pagination: paginate everything
i’m trying to use this code for pagination, but nothing appear :
<txp:if_individual_article>
<txp:article />
<txp:else />
<h1><txp:section title=“1” /></h1>
<txp:article form=“article_listing” limit=“4” />
<txp:etc_pagination />
</txp:if_individual_article>
Offline