You are here: Foswiki>Tasks Web>Item2616 (06 Jan 2015, GeorgeClark)Edit Attach

To include a condition, ala %IF%
TMPL:P already supports context conditions. It is very hard to work out the semantics for any more complex if expressions, as template definitions are expanded when they are loaded (hence the "TMPL:" part of the name), and there is no control over when they are loaded (they may be cached from a previous load, for example). Therefore TMPL: expressions have to be evaluated statically. Even context is extremely dodgy. You certainly can't assume any variable definitions, you can't assume and URL params. If you want to use these in the condition, you might as well use %IF.

In fact, I think this should be remove context conditionals from TMPL:P, so that templates can be cached.

CC

ItemTemplate edit

Summary Add TMPL:IF or extend TMPL:P
ReportedBy TWiki:Main.MeredithLesly
Codebase
SVN Range Thu, 29 Jun 2006 build 10750
AppliesTo Engine
Component
Priority Enhancement
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r6 - 06 Jan 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy