• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

I've just spent ages to find why a page title wouldn't change when I really did change it in a template. It occurred that the obscure edittext.pattern.tmpl was being called.

I guess that it's as simple as putting a HTML comment in specific template parts (one per template, if that is not a conditional part).

See the just checked in edittext.pattern.tmpl for instance (revision 6714).


this doesn't work:

Index: Templates.pm
--- Templates.pm        (revision 6751)
+++ Templates.pm        (working copy)
@@ -341,7 +341,8 @@
     # if the name ends in .tmpl, then this is an explicit include from
     # the templates directory. No further searching required.
     if( $name =~ /\.tmpl$/ ) {
-        return TWiki::readFile( $TWiki::cfg{TemplateDir}.'/'.$name );
+       my $filenameTemplate = $TWiki::cfg{TemplateDir}.'/'.$name;
+        return "<!-- $filenameTemplate -->" . TWiki::readFile( $filenameTemplate );

     my @skinList = split( /,+/, $skins );
@@ -444,7 +445,7 @@
         my $retrieve = $candidate->{retrieve};
         my $name = $candidate->{name};
         if( &$validate( $name )) {
-            return &$retrieve( $name );
+            return "<!-- $name -->" . &$retrieve( $name );

however, this is a snippet of what that produces:

<!-- /home/.balder/wbniv/twiki/templates/view.pattern.tmpl --><!-- /home/.balder/wbniv/twiki/templates/twiki.pattern.tmpl -->

<p />

<p />

<p />

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

this is harder to do than it appears, i guess a second pass cleans up empty =P='s at the head of the topic. so, while it would be useful, i doubt it's going to happen for Dakar; therefore, i'm deferring this. also, for purely debugging purposes, you can use the above patch; it won't produce valid HTML, but it can help you in debugging.

also, how would you control whether this output is turned on or not?


Undeferred, post Dakar CC

Summary For debugging there should be a way to tell from rendered html which templates are being called
ReportedBy ArthurClemens
SVN Range

AppliesTo Engine

Priority Enhancement
CurrentState New

Checkins 6966
TargetRelease major
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r5 - 2006-02-13 - CrawfordCurrie
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback