Tags:
create new tag
, view all tags

Feature Proposals » VIEW_TEMPLATE and EDIT_TEMPLATE variables to be made dynamic

Summary

Current State: Developer: Reason: Date: Concerns By: Bug Tracking: Proposed For:
MergedToCore HideyoImazu AcceptedByReleaseMeeting 2016-02-17   TWikibug:Item7729 KampalaRelease

Edit Form

TopicSummary:
CurrentState:
CommittedDeveloper:
ReasonForDecision:
DateOfCommitment:   Format: YYYY-MM-DD
ConcernRaisedBy:
BugTracking:
OutstandingIssues:
RelatedTopics:
InterestedParties:
ProposedFor:
TWikiContributors:
 

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

WhatDoesItAffect: Rendering

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

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2016-02-29 - HideyoImazu
 
  • 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.