r9 - 29 Apr 2006 - 13:16:16 - SamHaslerYou are here: TWiki >  Codev Web > AddParentVariableToTemplate
Tags:
, create new tag

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 | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r9 < r8 < r7 < r6 < r5 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo