|
Main sidebar
|
PITS /
01069Summary: Last PTV of same name wins, it should be first
Created: 2009-02-02 06:29
Status: Awaiting feedback
Category: CoreCandidate
From: HansB
Assigned:
Priority: 51
Version: 2.2.0
OS:
Description:If there are several PTVs with same name, the later one in the pattern array and in the page will be used. I think it would be more intuitive if the first PTV of same name will be used, as one often uses PTV for data at the top of a page, and does not want it to be corrupted by a later inclusion of a PTV with same name.
For instance something like
Suggested Remedy:A change to the core PageTextVar function adding code if (isset($pc["=p_{$m[2]}"])) continue;
after line foreach($match as $m) {
No, I really don't like this idea. It seems more intuitive to me that a later PTV will override an earlier one. So if you must add this feature, PLEASE make it optional. Kathryn Andersen July 08, 2009, at 12:58 PM It is not even the last PTV which wins, it depends on the order of processing of the
So Whatever we do we need to be consistent (principle of least surprise). Currently if asked I would have said that in a page the last (title, summary, PTV, ...) wins, so to speak. OTOH the first anchor (if multiple with the same name) is selected for include, pagelist, etc. simon July 16, 2009, at 04:20 PM There is no such thing "multiple anchors with the same name", in HTML it is forbidden, if PmWiki finds such a markup, it just nukes it away. Unlike programming languages, where a variable could be redefined many times and the last one wins. --Petko August 26, 2009, at 07:25 PM Don't know what I was thinking of, ahem Simon August 26, 2009, at 08:46 PM
Some suggestions/request:
VKrishn May 16, 2010, at 04:26 PM |