• 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.

Item5934: Inconsistent use of Local vs Set

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal No Action Required   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

According to TWiki/TWikiTemplates#Finding_Templates:

Two preference variables can be used to override the templates used:
   * =VIEW_TEMPLATE= sets the template to be used for viewing a topic
   * =EDIT_TEMPLATE= sets the template for editing a topic.
If these preferences are set locally (using _Local_ instead of _Set_) for a topic, in WebPreferences, in [[%LOCALSITEPREFS%]], or [[%SYSTEMWEB%.TWikiPreferences]] (using _Set_), the indicated templates will be chosen for =view= and =edit= respectively. The template search order is as specified above.

However, although I have successfully used Local in a 4.1.1 TWiki, my 4.1.2 TWiki seems to be requiring me to use Set.

Given that I was also troubleshooting a different problem (described in Item5933), the fact that Local wasn't working made the troubleshooting more frustrating.

-- TWiki:Main/VickiBrown - 17 Aug 2008

I have spent an hour trying to reproduce this and everything works as it should.

Are you sure you understand the concept of Local?

Local means the setting only applies to the topic in which it is used. So if you set the VIEW_TEMPLATE in a topic to change the view of that single topic - it makes no difference if you use Local or Set.

If you use Local in WebPreferences then it means this view template applies to the WebPreferences topic only.

If you use Set in WebPreferences then it means the view template applies to all the topic in the web.

For the setting to also apply in Subwebs the template name path must be found also in the subweb. If you want to use ONE template for both web and subwebs simply use the full path for the template topic.

Example * Set VIEW_TEMPLATE = Myweb.MyviewTemplate

The two places where Local makes sense are in the user home topic where we use it today to make the form appear at the top. Using Set would change the VIEW_TEMPLATE for the user everywhere.

The other place are in preferences topics. Web and Twiki prefs. Here you can even use both in combination. Example (intentionally added one space too many to show the raw text)

* Set VIEW_TEMPLATE = SpecialView * Local VIEW_TEMPLATE = PrefsView

Will set the VIEW_TEMPLATE for all topics in this web to SpecialView except in this preferences topic where we use a PrefsView template.

I cannot see any action on this one. It all works fine in 4.2.2. It could perhaps be an old bug in 4.1.2. I do not feel like spending another hour on an old version so I am not going to do that.

I set to no action. If the bug was in 4.1.2 and is now fixed then the right state should be Closed.

-- TWiki:Main.KennethLavrsen - 17 Aug 2008

ItemTemplate
Summary Inconsistent use of Local vs Set
ReportedBy TWiki:Main.VickiBrown
Codebase 4.1.2
SVN Range TWiki-5.0.0, Mon, 11 Aug 2008, build 17408
AppliesTo Engine
Component

Priority Normal
CurrentState No Action Required
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2008-08-17 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback