Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2020-01-29 06:16:39

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,271
Website

Re: Feedback to: Textpattern CMS 4.8.0-beta.2 released

Pat64 wrote #321389:

:D

Always a big fan of Oleg’s suggestions!

For a better presentation:

<nav aria-label="Page navigation" class="pagination-outer">...

<style>...

Cold someone explain what shift="2,1" actually mean? I am experimenting with this but I am not sure how to push it beyond the example. Could we, for example have 1,2,3,...,80,81,82,...,last-3,last-2,last or is that functionality only for the etc_pagination (and similar plugins) domain?


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#12 2020-01-29 06:22:11

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,271
Website

Re: Feedback to: Textpattern CMS 4.8.0-beta.2 released

etc wrote #321383:

Yiannis, etc_pagination might need to be updated or you might not need it any more. Feel free to report on plugin’s thread.

Just to say that I think that I resolved the issue. It was, as always, my bad use of the tag:)


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#13 2020-01-29 06:59:59

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,271
Website

Re: Feedback to: Textpattern CMS 4.8.0-beta.2 released

Using the /section/category/title schema there seems to be a problem with <txp:page_url /> in article_lists, when used in the following context.

> Edit my bad… again! I had a typo.

Last edited by colak (2020-01-29 07:18:12)


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#14 2020-01-29 07:56:44

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

Re: Feedback to: Textpattern CMS 4.8.0-beta.2 released

colak wrote #321406:

Cold someone explain what shift="2,1" actually mean? I am experimenting with this but I am not sure how to push it beyond the example. Could we, for example have 1,2,3,...,80,81,82,...,last-3,last-2,last or is that functionality only for the etc_pagination (and similar plugins) domain?

Feel free to experiment:

<nav>
    <txp:newer shift="-1,-2,-3">Page <txp:yield item="page" /></txp:newer>
    <txp:hide process="2"><txp:newer shift="-4" link="">...</txp:newer></txp:hide>
    <txp:newer shift="2,1" break=" ">Page <txp:yield item="page" /></txp:newer>
    <txp:newer shift="0" link="">Page <txp:yield item="page" /></txp:newer>
    <txp:older shift="1,2" break=" ">Page <txp:yield item="page" /></txp:older>
    <txp:hide process="2"><txp:older shift="-4" link="">...</txp:older></txp:hide>
    <txp:older shift="-3,-2,-1">Page <txp:yield item="page" /></txp:older>
</nav>

Offline

#15 2020-01-29 07:59:40

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,117
Website

Re: Feedback to: Textpattern CMS 4.8.0-beta.2 released

etc wrote #321386:

Here is something to get you started, please test:

<nav>…

I am slowly understanding a little bit how that works, I think. I had to fine-tune my template to get it to somewhat work. My first step had been to adjust downwards the limit attribute in my main <txp:article /> to generate a multipage list (now 5 pages). Then, I had the following I’m the <head /> of my template. according to the comment it is needed to allow newer/older to work there (before any article tag).

<txp:hide process><!-- count articles for link rel=prev/next --><txp:article pgonly="1" limit="4" /></txp:hide>

Removing that line got the example to work I think, but my link rel="next/prev stopped working.
On the real world site with much the same template, I use etc_pagination.

And tell me however what’s wrong with etc_pagination. Thanks!

so far etc_pagination works ell on my side (humble needs and all that).


Where is that emoji for a solar powered submarine when you need it ?

Offline

#16 2020-01-29 10:57:33

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,369
Website

Re: Feedback to: Textpattern CMS 4.8.0-beta.2 released

Myusername wrote #321390:

I don’t know if it’s known to the developers, but the 4.8.0-beta and 4.8.0-dev demo are misaligned on the mobile.

I think this is now fixed in latest dev version, based on a suggestion by Philippe. Let me know if not. Cheers!

Offline

#17 2020-01-29 15:24:06

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,326
Website

Re: Feedback to: Textpattern CMS 4.8.0-beta.2 released

etc wrote #321412:

Feel free to experiment:

I have a question.

<txp:variable name="firstpage" value='<txp:newer shift="-1" link=""><txp:yield item="page" /></txp:newer>' />

<txp:variable name="nextprevpage" value='<txp:newer shift="2" link=""><txp:yield item="page" /></txp:newer>' />

<txp:variable name="prevpage" value='<txp:newer shift="1" link=""><txp:yield item="page" /></txp:newer>' />

<txp:variable name="currentpage" value='<txp:newer shift="0" link=""><txp:yield item="page" /></txp:newer>' />

<txp:variable name="nextpage" value='<txp:older shift="1" link=""><txp:yield item="page" /></txp:older>' />

<txp:variable name="nextnextpage" value='<txp:older shift="2" link=""><txp:yield item="page" /></txp:older>' />

<txp:variable name="lastpage" value='<txp:older shift="-1" link=""><txp:yield item="page" /></txp:older>' />

<p>First Page: <txp:variable name="firstpage" /></p>

<p>Next Previous Page: <txp:variable name="nextprevpage" /></p>

<p>Previous Page: <txp:variable name="prevpage" /></p>

<p>Current Page: <txp:variable name="currentpage" /></p>

<p>Next Page: <txp:variable name="nextpage" /></p>

<p>Next Next Page: <txp:variable name="nextnextpage" /></p>

<p>Last Page: <txp:variable name="lastpage" /></p>

outputs

<p>First Page: 1</p>

<p>Next Previous Page: </p>

<p>Previous Page: 2</p>

<p>Current Page: 3</p>

<p>Next Page: 4</p>

<p>Next Next Page: 5</p>

<p>Last Page: </p>

It seems like once you get an answer with shift (ex. firstpage and nextprevpage should both be 1), you can’t get it again. Is there a way to reset this?

Addendum:

If you include the line of code in the head that phiw13 mentions above, the output becomes:

<p>First Page: 1</p>

<p>Next Previous Page: </p>

<p>Previous Page: 2</p>

<p>Current Page: 3</p>

<p>Next Page: </p>

<p>Next Next Page: </p>

<p>Last Page: </p>

Offline

#18 2020-01-29 16:45:45

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

Re: Feedback to: Textpattern CMS 4.8.0-beta.2 released

michaelkpate wrote #321420:

It seems like once you get an answer with shift (ex. firstpage and nextprevpage should both be 1), you can’t get it again. Is there a way to reset this?

You can try showalways="1" attribute, but be careful if prevpage does not exist.

Offline

#19 2020-01-29 17:22:00

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,326
Website

Re: Feedback to: Textpattern CMS 4.8.0-beta.2 released

etc wrote #321421:

You can try showalways="1" attribute, but be careful if prevpage does not exist.

That solved it. And I will.

And I just realized that

<txp:older shift="-1" link="" showalways="1"><txp:yield item="page" /></txp:older>

won’t return the last page if you are on the last page.

<txp:variable name="currentpage" value='<txp:newer shift="0" link="" showalways="1"><txp:yield item="page" /></txp:newer>' />

<txp:variable name="lastpage" value='<txp:older shift="-1" link="" showalways="1"><txp:yield item="page" /></txp:older>' />

<txp:if_variable name="lastpage" value="">
    <txp:variable name="lastpage" value='<txp:variable name="currentpage" />' />
</txp:if_variable>

Offline

#20 2020-01-29 20:51:38

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

Re: Feedback to: Textpattern CMS 4.8.0-beta.2 released

michaelkpate wrote #321423:

And I just realized that … shift="-1" … won’t return the last page if you are on the last page.

That’s right, to avoid duplicate last page links. But I have changed (in dev) the valueless shift in such a way that <txp:older shift /> will always link to the last page, even if you are on.

Offline

Board footer

Powered by FluxBB