Textpattern CMS support forum

You are not logged in. Register | Login | Help

#41 2013-09-24 13:36:20

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 198
Website

Re: etc_pagination: paginate everything

It works!!!

Your plugin is awesome! I’ve installed the dev_version and added <div class="pagination-info">Page <txp:etc_offset type="counter" /> of <txp:etc_numpages /></div> to my code and the output is <div class="pagination-info">Page 1 of 3</div>.

Thank you Oleg!

Last edited by robhert (2013-09-24 14:52:57)

Offline

#42 2013-09-30 19:18:56

etc
Developer
Registered: 2010-11-11
Posts: 3,145
Website

Re: etc_pagination: paginate everything

Version 0.4 released as beta for the moment, more functional and flexible, please welcome. It incorporates Robhert’s suggestions and more, but is not fully compatible with v.0.3, so test before use. For example, the output above can be obtained with

<txp:etc_pagination range="0">
	<div class="pagination-info">Page {*} of {pages}</div>
</txp:etc_pagination>

Last edited by etc (2013-10-02 09:44:53)


etc_[ query | search | pagination | date | tree | cache ]

Offline

#43 2013-10-08 17:03:37

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 198
Website

Re: etc_pagination: paginate everything

Hi Oleg!

It seems this code won’t work with the newest version of your plugin because there is no active tag.

<txp:etc_pagination wraptag="ul" class="pagination" active="class='current'" link="<a class='page-number button' href='{href}'>{*}</a>" current="<span class='page-number'>{*}</span>" next="<a class='page-next' href='{href}'>Next</a>">
	<li {active}>{link}</li>
</txp:etc_pagination>

What I need is this

<span class='current'>1</span>
<a href='#' class='page larger'>2</a>
<a href='#' class='nextpostslink'>&raquo;</a>

But I don’t know how to get that ouput. I tried many times, and the only code that partially works is this:

<txp:etc_pagination link="<a class='page larger' href='{href}'>{*}</a>" current="<span class='current'>{*}</span>" prev="<a class='prevpostslink' href='{href}'>&laquo;</a>" next="<a class='nextpostslink' href='{href}'>&raquo;</a>">
	{link}
</txp:etc_pagination>

Works, but there is no current page selection (All links are active).

Could you give me a hand with this?

Thank you very much.

Robhert

Offline

#44 2013-10-08 19:12:58

etc
Developer
Registered: 2010-11-11
Posts: 3,145
Website

Re: etc_pagination: paginate everything

Hi Robhert,

yes, there are few changes (whence my warning), but you are almost there:

<txp:etc_pagination link="<a class='page larger' href='{href}'>{*}</a>,<span class='current'>{*}</span>"
	prev="<a class='prevpostslink' href='{href}'>&laquo;</a>" next="<a class='nextpostslink' href='{href}'>&raquo;</a>"
>
	{link}
</txp:etc_pagination>

should be ok. Each “link” attribute (like link, next and so on) can come in two states now: general,special; and the current attribute plays the role of ex – active (gone). For example, if you want to show some “next” text even on the last page, you can put

next="<a class='nextpostslink' href='{href}'>&raquo;</a>,<span class='nextpostslink'>&raquo;</span>"

Sorry for somewhat cowboyish plugin help, I hate wtfm.

Last edited by etc (2013-10-08 21:00:30)


etc_[ query | search | pagination | date | tree | cache ]

Offline

#45 2013-10-08 23:58:47

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 198
Website

Re: etc_pagination: paginate everything

Thank you Oleg! Works like a charm!

Offline

#46 2013-11-01 09:09:29

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

Re: etc_pagination: paginate everything

Hi,
I’m trying to use this great plugin on a local site using MLP.
Unfortunatly, the pagination links are http://localhost:8888/en/?pg=3 instead of http://localhost:8888/mywebsite/en/?pg=3.
I’m pretty sure that it’s not a big deal, but I can’t find what to do to make it works…
Thanks for your help!

Last edited by NicolasGraph (2013-11-01 09:11:16)


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

Offline

#47 2013-11-01 11:20:57

etc
Developer
Registered: 2010-11-11
Posts: 3,145
Website

Re: etc_pagination: paginate everything

Hi Nicolas,

that’s a strange issue, though I have never used MLP. If you don’t set the root attribute, the plugin generates just ?pg=3 (or &pg=3) local links (check the page source), so they should be appended by the browser to the page url. What if you manually create some <a href="?pg=3">#</a> link on the page where you use etc_pagination, will it be transformed into http://localhost:8888/en/?pg=3 or http://localhost:8888/mywebsite/en/?pg=3?

Edit: you can try to pass root=’<txp:page_url />’ to etc_pagination.

Last edited by etc (2013-11-01 11:41:47)


etc_[ query | search | pagination | date | tree | cache ]

Offline

#48 2013-11-01 12:00:06

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

Re: etc_pagination: paginate everything

Hi Oleg,
Thanks for your help.
the problem is the same with <a href="?pg=3">#</a>. It means that it doesn’t come from the plugin, isn’t it?
I tried to pass root=’<txp:page_url />’ to etc_pagination but the result is http://localhost:8888/en/mywebsite/?pg=3 instead of http://localhost:8888/mywebsite/en/?pg=3.

Last edited by NicolasGraph (2013-11-01 12:15:57)


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

Offline

#49 2013-11-01 13:45:38

etc
Developer
Registered: 2010-11-11
Posts: 3,145
Website

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 is http://localhost:8888/en/mywebsite/?pg=3 instead of http://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?


etc_[ query | search | pagination | date | tree | cache ]

Offline

#50 2013-11-01 13:58:43

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

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)


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

Offline

Board footer

Powered by FluxBB