Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2007-09-06 15:54:04

guiguibonbon
Member
Registered: 2006-02-20
Posts: 296

Re: wraptag for txp:older/newer/link_to...

That’s why I suggested aliases (keep both tags).

Offline

#14 2007-09-06 17:11:08

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: wraptag for txp:older/newer/link_to...

guiguibonbon wrote:

BTW, devs, don’t know if this has been brought up before, but I’m always confused by these tags’ names. I think they should be renamed txp:link_to_prev_page and txp:link_to_next_page. Older and newer don’t mean a thing, since you can sort your articles in reverse order. It would also harmonize things with txp:link_to_prev and txp:link_to_prev. Maybe create an alias function, for backwards compatibility?

This will also make sense in the context of a search results pagination.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#15 2007-09-06 17:30:21

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: wraptag for txp:older/newer/link_to...

guiguibonbon wrote:

Or is it the documentation that has it wrong ?

<txp:older>Previous</txp:older>
<txp:newer>Next</txp:newer>
Shouldn’t that be the reverse, or :

<txp:newer>previous page</txp:newer> // link to p-1
<txp:older>next page</txp:older> // link to p+1
I’m telling you : confusing.

The documentation page, that you link to is probably wrong ( not the alpahabetical tag listing )
This Tag, does exactly what it is supposed to do, for me.

older: -> generates pagination link to page+1
newer: -> pag link to page -1

However, the documentation is a litle fuzzy.

I could update the info.

regards, marios

Last edited by marios (2007-09-06 17:32:57)


⌃ ⇧ < ⌃ ⇧ >

Offline

#16 2007-09-06 19:11:37

guiguibonbon
Member
Registered: 2006-02-20
Posts: 296

Re: wraptag for txp:older/newer/link_to...

oh, marios, please do. This page also has it wrong then. And this doesn’t make it clearer :

Textpattern will replace this tag with an XHTML link to the next list of articles in the sort order. […] An article list consists of the assigned number of articles set by the article tag. If there are no articles available having Newer status (articles ranked higher, or newer, in the present sort criteria than the present top of page article) <txp:newer> will not display unless the showalways attribute is set to 1. It is normally seen used in tandem with <txp:older>

Given a <txp:article limit =“5” /> tag on the page in question, <txp:newer> will page up five articles at a time from the oldest post forward in time to the most recently posted article.

I’m still not quite sure it means what it’s supposed to mean.

Offline

#17 2007-09-06 21:07:56

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: wraptag for txp:older/newer/link_to...

Dare I say this… changing tag names is something that can be done in crockery. Providing aliases is just plain ugly :)

Offline

#18 2007-09-06 21:19:40

guiguibonbon
Member
Registered: 2006-02-20
Posts: 296

Re: wraptag for txp:older/newer/link_to...

Haha. I don’t mind this time. As long as the doc makes things clearer. But do consider it for c… cro… crockery (pfew, i said it).

How about the if_page and if_neighbours tags? Do you think these could be useful?

And don’t forget about the wraptags. That’s an easy and valid fix I think.

Offline

#19 2007-09-06 21:38:31

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: wraptag for txp:older/newer/link_to...

Wiki login returns a 500. I’ve told Patrick.
So this has to wait.
I guess, ruud and Mary agree, that we should update documentation.

regards, marios

Last edited by marios (2007-09-06 21:38:53)


⌃ ⇧ < ⌃ ⇧ >

Offline

#20 2007-09-07 07:22:44

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: wraptag for txp:older/newer/link_to...

I’m always very skeptical regarding both aliases and changing tag names.

Like all software txp is learned, once you learn the tags you know what they do. An alias is just one step towards the changing of the tag name. It is a dangerous step as users will not know that anything changed or that it will eventually change.

I find that the “cloning stamp” tool in photoshop is unfortunately named (the stamp part that is!… Brush makes more sense to me) but I would not want to see it change as i will need to relearn something which by now is part of my automatic motions when I work with the application.

Aliasing or changing tags in txp will have a worse effect to the changing of the photoshop tool as a lot of sites will eventually malfunction until the tags are replaced.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#21 2007-09-07 09:49:17

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: wraptag for txp:older/newer/link_to...

To some extent, replacing tags can be done as part of an upgrade script, I think.

Offline

#22 2007-09-07 10:17:41

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: wraptag for txp:older/newer/link_to...

ruud wrote:

To some extent, replacing tags can be done as part of an upgrade script, I think.

That sounds like the perfect solution:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#23 2008-02-29 10:25:05

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: wraptag for txp:older/newer/link_to...

guiguibonbon, this thread was fun to read. It didn’t quite work as I imagined and I had to play around with your if page to get it to work. One problem remains – this bit of your function also has to test for numpages >1 or in all cases when you specify a page="" attribute it will also produce output when there is only a single page of results.

if ($page) {
		$page = ($page == "last") ? $numPages : $page;
		return parse(EvalElse($thing, in_list($pg, $page)));
	}

I just stuck and if (numpages >1) around it for the moment…


TXP Builders – finely-crafted code, design and txp

Offline

#24 2008-03-16 14:41:21

guiguibonbon
Member
Registered: 2006-02-20
Posts: 296

Re: wraptag for txp:older/newer/link_to...

Like this ?

function if_page($atts, $thing) {

	global $thispage;

	extract(lAtts(array( 'page' => '' ), $atts));

	extract($thispage);

	if ($numPages < 1)
		return '';

	if ($page) {
		$page = ($page == "last") ? $numPages : $page;
		return parse(EvalElse($thing, in_list($pg, $page)));
	}

	else return parse($thing);
}

Offline

Board footer

Powered by FluxBB