Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#205 2017-03-20 22:29:42

etc
Developer
Registered: 2010-11-11
Posts: 4,435
Website GitHub

Re: etc_pagination: paginate everything

Yep, your site seems to work faster now. Have you cached “Category slates” and “Months menu” too? Good luck, and glad to help! :-)

Offline

#206 2017-09-03 17:54:19

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,466

Re: etc_pagination: paginate everything

Can someone please show me how I can bring these two elements to work? With section (or with category in an other case). All my experiments with the examples given in the help and in the forum gave no outputs.

I need only this basic pagination:

<txp:article_custom section="section-name" sort="LastMod desc" limit="12" form="form-name" />

<txp:etc_pagination range="0">
    <p>Page {*} of {pages}</p>
</txp:etc_pagination>

Offline

#207 2017-09-03 20:20:53

etc
Developer
Registered: 2010-11-11
Posts: 4,435
Website GitHub

Re: etc_pagination: paginate everything

GugUser wrote #306832:

Can someone please show me how I can bring these two elements to work? With section (or with category in an other case).

I guess you need to paginate <txp:article_custom /> list? Then you need to calculate the number of pages and offset:

<txp:article_custom section="section-name" sort="LastMod desc" limit="12" offset='<txp:etc_offset pgcounter="page" pageby="12" />' form="form-name" />

<txp:variable name="numPages" value='<txp:etc_numpages section="section-name" pageby="12" />' />

<txp:etc_pagination pages='<txp:variable name="numPages" />' pgcounter="page" range="0">
	Page {*} of {pages}.
</txp:etc_pagination>

Adding page=3 (say) to url will land you on the 3rd page. Hope that helps.

Offline

#208 2017-09-03 22:20:18

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,466

Re: etc_pagination: paginate everything

This works, many thanks.

This means that all for the pagination relevant attributes from <txp:article />, but unknown to <txp:article_custom />, can be placed in offset=' ', also pgonly?

That’s great, thank you.

I was confused, amongst other things, by this example, where there is no variable which transfers the data, and where pgonly="0" (without being an attribute of <txp:article_custom />) is outside the offset=' '.

Offline

#209 2017-09-04 02:51:44

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,466

Re: etc_pagination: paginate everything

No, with pgonly in <txp:article_custom />, inside the offset=' ', it can’t work. I made it with en empty form.

In this manner the <txp:article_custom /> that is only for pgonly isn’t shown.

Offline

#210 2017-09-04 10:01:14

etc
Developer
Registered: 2010-11-11
Posts: 4,435
Website GitHub

Re: etc_pagination: paginate everything

GugUser wrote #306839:

No, with pgonly in <txp:article_custom />, inside the offset=' ', it can’t work.

FYI, in 4.7-dev <txp:article_custom section="some-section" pageby="12" pgonly /> returns the number of matching pages. We could also enhance its offset attribute to treat non-numeric values as page number url parameter. So

<txp:article_custom section="some-section" limit="12" offset="page" />

would output the 3rd page of 12 articles (articles 25—36) if url query string contains page=3.

Offline

#211 2017-10-28 18:28:20

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 782
Website

Re: etc_pagination: paginate everything

So far so good > joopvos.nl/test … :)

If you click on an image (thumbnail) you’ll land on an individual page. A sub navigation (arrows) brings you to the next, prev or the thumbnails … on page 1 … always. That’s not what I want if you departed from page 2 or 3. It must bring you back to the same page. The next and prev arrows are going to the beginning and/or end of all the individual pages. That’s not what I want.

I’ve read that etc_pagination doesn’t work with/on individual pages. Nevertheless … is it possible with or without etc_pagination to accomplish this behaviour?

The form with the sub navigation >

<article role=“article” itemscope itemtype=“http://schema.org/Article”>

<div class=“section_nav”><span><txp:jra_link_to_prev sort=“position asc” showalways=“1”>&#60;</txp:jra_link_to_prev></span> | <span><a href=”<txp:site_url /><txp:section />”>&#60;</a></span> | <span><txp:jra_link_to_next sort=“position asc” showalways=“1”>&#62;</txp:jra_link_to_next></span></div>

<h1 itemprop=“name”><txp:title /></h1>

<div itemprop=“articleBody”>
<txp:body />
</div>

</article>

BTW … I’m using the stm_article_order plugin with the jra_links plugin because the last one works nicely with the first one (tip!) … :)

Last edited by RedFox (2017-10-30 09:07:47)

Offline

#212 2017-10-30 11:25:30

etc
Developer
Registered: 2010-11-11
Posts: 4,435
Website GitHub

Re: etc_pagination: paginate everything

Hi Joop, if I get you right, you want to constraint the next/prev/up links to page limits? Can not think of a core way, but etc_link_to almost does it. Leave me a day or two to get rid of “almost” :-)

Offline

#213 2017-10-30 15:14:28

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 782
Website

Re: etc_pagination: paginate everything

Thanks Oleg … I’m preparing myself to get familiar with etc_link_to and I discovered that the plugin works well with smd_article_order too … :)

<div class=“section_nav”><span><txp:etc_link_to target=“prev” sort=“position asc” showalways=“1”>&#60;</txp:etc_link_to></span> | <span><a href=”<txp:site_url /><txp:section />”>&#60;</a></span> | <span><txp:etc_link_to target=“next” sort=“position asc” showalways=“1”>&#62;</txp:jra_link_to></span></div>

On the other hand I think showalways="1" brings you back to the first thumbnail page … !?

Last edited by RedFox (2017-10-30 15:24:31)

Offline

#214 2017-11-02 22:47:44

etc
Developer
Registered: 2010-11-11
Posts: 4,435
Website GitHub

Re: etc_pagination: paginate everything

So, install etc_link_to.0.4.7 and try

<div class="section_nav">
<span><txp:etc_link_to target="prev" pageby="4" showalways="1">&#60;</txp:etc_link_to></span>
 | 
<span><a href="<txp:site_url /><txp:section />?page=<txp:etc_link_page pageby='4' />">&#60;</a></span>
 | 
<span><txp:etc_link_to target="next" pageby="4" showalways="1">&#62;</txp:etc_link_to></span>
</div>

showalways="1" means that (unlinked) arrows will be shown even if there is no next/prev article. Hope that helps.

Offline

#215 2017-11-03 06:54:59

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 782
Website

Re: etc_pagination: paginate everything

Thanks Oleg. The link to the specific landing page (we have now 4 of these) does work (arrow up) … :)

The links to the next and previous individual page do work too. Only when you’re at the first or last individual page you’re directed to the (first) specific landing page. It would be nice if the arrow in that case wasn’t a link at all. Because there is no individual page left. Nor on the ‘left’; nor on the ‘right’. Can that be done?

Oleg, would access to the back-end (Textpattern) of the test site be of any help?

Last edited by RedFox (2017-11-03 10:26:20)

Offline

#216 2017-11-03 10:18:35

etc
Developer
Registered: 2010-11-11
Posts: 4,435
Website GitHub

Re: etc_pagination: paginate everything

Sorry, Joop, the problem was on my side. Please redownload and retry.

Offline

Board footer

Powered by FluxBB