Tags:
create new tag
view all tags

Bug: User topic Templates aren't found the way the documentation presents the search order

I'm trying to use a user topic in a Web, to define a view template for this web's specific skin, instead of having to change things into .../templates/

I think there is a bug (either in the code or the docs, but rather in the code) in the way the search for the right topic is done.

The documentation (see the left column of the table at TWikiTemplates states that the order is the following, "if a skin is specified" :

  1. templates/%WEB%/script.skin.tmpl
  2. templates/script.skin.tmpl
  3. data/%WEB%/SkinSkinScriptTemplate.txt
  4. data/TWiki/SkinSkinScriptTemplate.txt

But instead, if I add new skin template in a topic which is named SkinSkinScriptTemplate, what I noticed is that the following is looked for in the _readTemplateFile() function :

  1. templates/%WEB%/script.skin.tmpl
  2. templates/script.skin.tmpl
  3. templates/script.tmpl
  4. data/%WEB%/SkinSkinScriptTemplate.txt
  5. data/TWiki/SkinSkinScriptTemplate.txt

I think that in TWiki::Store::_readTemplateFile(), the "default" case (i.e. loading script.tmpl, the third step, here) should apply only in the end, if nothing else worked, and especially if no user topic named SkinSkinScriptTemplate was found...

I will try to provide a clean patch as soon as this is confirmed to be a bug and the doc are indeed right...

Test case

  1. Create a new Web, say Foo
  2. Add a topic named FooSkinViewTemplate defining a new template
  3. Define Set SKIN = foo in Foo's WebPreferences

The pages in the Foo web should be viewed according to the new view template.

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  

-- OlivierBerger - 01 Jul 2005

Impact and Available Solutions

Follow up

Added a comment in TWiki.TWikiTemplates to track this problem.

-- OlivierBerger - 01 Jul 2005

Fix record

Discussion

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2005-07-02 - WillNorris
 
  • Learn about TWiki  
  • Download TWiki
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.