r6 - 29 Apr 2006 - 13:17:15 - SamHaslerYou are here: TWiki >  Codev Web > AddParentVariableToTemplate > MetaExpansionImprovements
Tags:
, create new tag
Following moved from AddParentVariableToTemplate

Here's a patch for TWikiBetaRelease2004x05x07; I've been using it for AthensRelease quite some time:

--- /var/tmp/twiki20040507beta/lib/TWiki/Render.pm      Sat May  1 08:53:36 2004
+++ ./Render.pm Fri Jun  4 11:25:39 2004
@@ -87,6 +87,7 @@
     my $prefix = "";
     my $suffix = "";
     my $usesep = "";
+    my $raw = "";
 
     if( $args ) {
        $dontRecurse = TWiki::extractNameValuePair( $args, "dontrecurse" );
@@ -94,6 +95,7 @@
        $prefix =      TWiki::extractNameValuePair( $args, "prefix" );
        $suffix =      TWiki::extractNameValuePair( $args, "suffix" );
        $usesep =      TWiki::extractNameValuePair( $args, "separator" );
+       $raw =         TWiki::extractNameValuePair( $args, "raw" );
     }
 
     if( ! $usesep ) {
@@ -110,6 +112,7 @@
         my %parent = $meta->findOne( %_Q__Q_% );
         if( %parent ) {
             my $name = $parent{"name"};
+    return $name       if $raw;
             my $pWeb = $cWeb;
             my $pTopic = $name;
             if( $name =~ /^(.*)\.(.*)$/ ) {
This returns the unformatted, raw parent value if you type %META{"parent" raw="on"}%. Any suggestion for an option name better than raw="on"?

-- PeterKlausner - 04 Jun 2004

See also related FormattedSearchWithParentTopic, which is implemented in CairoRelease.

-- PeterThoeny - 27 Jul 2004

Better to make the syntax consistent with other variables. Possibly a format parameter? Deferring to DakarRelease.

-- PeterThoeny - 04 Aug 2004

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r6 < r5 < r4 < r3 < r2 | 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