Tags:
create new tag
, view all tags

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

Topic revision: r10 - 2008-08-13 - RafaelAlvarez
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.