Feature request: Add parent variable to template

A lot of times I miss the ability to simply get the topic's parent. Template/skin authors could be helped by adding a %PARENT% variable that can be read in templates.

Patch

Again, I have problems creating a patch file from UI/View.pm.
Anywhere, but perhaps at line 251 of UI/View.pm rev. 1.1:

if ( $meta ) {
 my %parent = $meta->findOne( %_Q__Q_% );
 my $parentName = "";
 if (%parent ) {
 $parentName = $parent{"name"};
 }
 $tmpl =~ s/%PARENT%/$parentName/go;
 }

-- ArthurClemens - 22 Apr 2004

Looks workable. Putting it on my queue...I think I'll probably get this and a few of the others in on Tuesday.

-- WalterMundt - 25 Apr 2004

Isn't this functionality already covered by %META{"parent"}% as documented in TWikiMetaData. To make it consistent I suggest not to introduce a new variable; if needed add a new switch to the %META{"parent"}% variable.

-- PeterThoeny - 25 Apr 2004

PeterKlausner's additional patch moved to MetaExpansionImprovements and assigned to Dakar. No-one in the core team seems interested in doing it for Cairo.

-- CrawfordCurrie - 08 Jul 2004

Fixed the form data, this is not in Cairo. Better to add a switch to %META{"parent"}%.

See also related FormattedSearchWithParentTopic, which is implemented in CairoRelease.

-- PeterThoeny - 27 Jul 2004

Edit | Attach | (削除) Watch (削除ここまで) | Print version | History : r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r10 - 2008年08月13日 - RafaelAlvarez
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

AltStyle によって変換されたページ (->オリジナル) /