Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,597
Website GitHub Twitter

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 | State Machines | NeMe @ github
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: 4,252
Website GitHub

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,338
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,503
Website GitHub Twitter

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!

Online

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

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

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: 4,252
Website GitHub

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,361
Website GitHub Mastodon

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: 4,252
Website GitHub

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

#21 2020-01-30 08:13:24

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,597
Website GitHub Twitter

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

This issue might be undoable, and it existed since the beginning of txp.

Is there a way to only count a complete file download? At the moment the file download number is incremented every time the link is clicked, without taking into consideration that the download may have been partial, and hence unreadable.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#22 2020-01-30 08:28:35

gaekwad
Multi-hyphenate
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 3,524
GitHub

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

colak wrote #321428:

Is there a way to only count a complete file download?

Web server log files. Depending on the server, and the format of the log files, it’s possible to log the number of bytes sent for a given request. Typically, a line in a web server log is written at the end of a request, so if a GET request for a 10MB file completes with 10MB being transferred, then that value can be written to the log file. If the user or process bombs out before the end, the bytes sent is written.

Web server log file analytics is what you’re looking for, I think. I’ve used Sawmill before, it’s proprietary and pay-for, but was good when I needed it. See also: en.wikipedia.org/wiki/List_of_web_analytics_software for ideas.

Offline

#23 2020-01-30 09:16:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,244
Website GitHub

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

Sadly not, Yiannis. Txp doesn’t know whether a download is canceled or is corrupt or if the power goes off mid-transaction. Once you click that link, and the dialog appears to save/view (or the download auto-starts, depending on your browser settings/mime type associations) the counter has been incremented. No way to do anything else.

It’s not like there’s even any callback or hook to get hold of when a download is complete, nor during its transfer. Once it’s passed over to the browser for download, it’s out of our hands.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#24 2020-01-30 11:33:28

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,597
Website GitHub Twitter

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

Bloke wrote #321430:

Sadly not, Yiannis. Txp doesn’t know whether a download is canceled or is corrupt or if the power goes off mid-transaction. Once you click that link, and the dialog appears to save/view (or the download auto-starts, depending on your browser settings/mime type associations) the counter has been incremented. No way to do anything else.

It’s not like there’s even any callback or hook to get hold of when a download is complete, nor during its transfer. Once it’s passed over to the browser for download, it’s out of our hands.

I thought that would be the case. No worries.

gaekwad wrote #321429:

Web server log file analytics is what you’re looking for, I think. I’ve used Sawmill before, it’s proprietary and pay-for, but was good when I needed it. See also: en.wikipedia.org/wiki/List_of_web_analytics_software for ideas.

A few weeks ago, I deleted Matomo from our site. For years I could track our visitors behaviour in our site, through slimstat, g-analytics, and piwik/Matomo. Since GDPR we opted to leave the cookie consent as unobtrusive as possible, because we would rather have visitors reading our content rather than having to give in to being tracked-be that in an ethical way. As such, I would rather not install any software for now and I will suffice with g-analytics, as pointless as it is for us now. Having said that www.openwebanalytics.com/ looks interesting.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB