Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: etc_pagination: paginate everything
Hi again Oleg,
Thanks for the GitHub access. I’d suggest uploading the plugin code and working on the README.textile file rather than on a Wiki page, similar to how we have done with zem_contact_reborn on GitHub.
GitHub supports Textile format so you can use the same documentation for the readme and within the plugin itself, which saves extra effort.
Offline
Re: etc_pagination: paginate everything
Thank you for your help, Phil! I need some time to get used to GitHub, but will upload the latest code after some testing. Unfortunately, the help file (inherited from ob1_pagination
plugin) was HTML formatted from the start.
Side-note: are we slowly migrating from .org to GitHub?
Offline
Re: etc_pagination: paginate everything
I’ve Textiled your help file and made a few alterations. It would be good to flesh this out with a few more examples (lifted from this forum thread) in due course.
I’ll leave it to you for now – happy GitHubbing!
Offline
Re: etc_pagination: paginate everything
That’s really kind of you, Phil, many thanks! I have uploaded the plugin php code, it includes now your help version that I will continue to complete. Is there any mean to keep it synced with the README file?
Offline
Re: etc_pagination: paginate everything
Hi Oleg,
You would have to cut and paste any changes you make to the readme into the plugin help section (and vice versa) to keep them in sync – at least that’s what I do.
Offline
Re: etc_pagination: paginate everything
philwareham wrote #289273:
You would have to cut and paste any changes you make to the readme into the plugin help section (and vice versa) to keep them in sync – at least that’s what I do.
Or just compile the plugin package from the readme instead of having some (shitty, may I add) singular PHP file zrc_template (or what the fuck it’s called) uses.
Would be great if the repository was Composer (the package manager, not that web GUI compiler) compatible too.
Offline
Re: etc_pagination: paginate everything
Gocom wrote #289289:
Would be great if the repository was Composer (the package manager, not that web GUI compiler) compatible too.
Carte blanche for any contribution, sir Jukka!
Offline
Re: etc_pagination: paginate everything
etc wrote #289290:
Carte blanche for any contribution, sir Jukka!
Maybe I will, maybe I will (if I don’t get royal lazy). Heck, I wandered here because I’ve already been working with etc_pagination’s code; reworked ancient rah_comments into etc_pagination “module/glue-plugin” last night.
Offline
Re: etc_pagination: paginate everything
Amazing, I will start to comment my code, promise! Probably, etc_pagination
needs some kind of qs
attribute, to unset/rewrite some parts of its root
url.
Edit: now done it in GitHub version, you don’t need to alter $_GET['commented']
anymore. Just call <txp:etc_pagination query="commented" ... />
to remove it from pagination links.
Last edited by etc (2015-03-23 17:51:27)
Offline
Re: etc_pagination: paginate everything
Hi Oleg, what’s the best way to output navigation links based on a <txp:article limit="1" />
tag? Here’s an example:
<txp:if_article_list>
<txp:article limit="1">
<txp:permlink><h3><txp:title /></h3></txp:permlink>
<txp:body />
</txp:article>
<txp:article limit="9" offset="1">
<txp:permlink><h3><txp:title /></h3></txp:permlink>
</txp:article>
<div class="article_nav">
<txp:etc_pagination range="2" prev="Previous" next="Next" wraptag="ul" break="li" />
</div>
</txp:if_article_list>
Basic idea is to display the first article in full, followed by a linked list of the next 9 articles, then paginate.
Unfortunately in the example above the plugin has 46 pagination links instead of 5 (there are 46 articles in this section), so I guess the limit="1"
is throwing things off.
Not sure if the second article tag <txp:article limit="9" offset="1"> may throw things off, the offset method does cause some issues with the in-built
<txp:older />@ and <txp:newer />
tags, as the next/prev pages will offset by 1 instead of the desired 1+9.
Offline
Re: etc_pagination: paginate everything
Hi Jonathan,
would pageby attribute help?
<txp:article limit="1" pageby="10">
<txp:permlink><h3><txp:title /></h3></txp:permlink>
<txp:body />
</txp:article>
<txp:article limit="9" offset="1" pageby="10">
<txp:permlink><h3><txp:title /></h3></txp:permlink>
</txp:article>
Haven’t tested, but if it works with core tags, it should work with etc_pagination
too.
You can also use one default <txp:article />
, and output the body with <txp:if_first_article />
tag. Or you need it only on the front page?
Offline
Re: etc_pagination: paginate everything
Hi Oleg, you’re a champ, as always. How could I forget the pageby
attribute :(
Yes, this if for the article_list page, so always want the latest article to show the body and then a link to the next 10 articles. The pagination works beautifully now. Thanks!
Offline