Motivation
It's handy if VIEW_TEMPLATE value can be determined dynamically.
Description and Documentation
If VIEW_TEMPLATE value has variables, they are expanded.
By the same token, EDIT_TEMPLATE value has its variables expanded. This is for consistency as well as convenience.
Examples
* Set VIEW_TEMPLATE = %IF{"'%CALCULATE{$SUBSTRING(%TOPIC%, 1, 4)}%' = 'Item'" then="ItemViewTmpl"}%
* Set EDIT_TEMPLATE = %IF{"'%CALCULATE{$SUBSTRING(%TOPIC%, 1, 4)}%' = 'Item'" then="editform"}%
Impact
Implementation
TWiki::UI::View::view() will be enhanced so that
VIEW_TEMPLATE value is processed with
TWiki::handleCommonTags().
--
Contributors:
Hideyo Imazu - 2016-02-16
Discussion
Proposal looks good. For performance I recommend testing for
%[A-Z] before calling
TWiki::handleCommonTags().
--
Peter Thoeny - 2016-02-17
I take your advice, Peter.
--
Hideyo Imazu - 2016-02-18
This proposal is accepted by
KampalaReleaseMeeting2016x02x18
--
Peter Thoeny - 2016-02-21
I've realized that EDIT_TEMPLATE needs to be treated in the same manner as VIEW_TEMPLATE for consistency, which is now reflected on the Description and Examples above.
--
Hideyo Imazu - 2016-02-29