Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#85 2015-03-21 07:46:38

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

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

#86 2015-03-21 13:05:29

etc
Developer
Registered: 2010-11-11
Posts: 5,062
Website GitHub

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

#87 2015-03-21 14:10:17

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

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

#88 2015-03-22 11:39:14

etc
Developer
Registered: 2010-11-11
Posts: 5,062
Website GitHub

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

#89 2015-03-22 13:07:39

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

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

#90 2015-03-22 21:53:21

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

#91 2015-03-22 22:02:39

etc
Developer
Registered: 2010-11-11
Posts: 5,062
Website GitHub

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

#92 2015-03-23 09:58:20

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

#93 2015-03-23 12:53:36

etc
Developer
Registered: 2010-11-11
Posts: 5,062
Website GitHub

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

#94 2015-05-25 10:33:07

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

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

#95 2015-05-25 14:33:40

etc
Developer
Registered: 2010-11-11
Posts: 5,062
Website GitHub

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

#96 2015-05-25 15:13:08

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

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

Board footer

Powered by FluxBB