Feature Proposal: Deprecate the TMPL language


The TMPL language is a very obscured and yet vital part of foswiki WikiApplications. This makes it much harder for new users that are buildingup confidence in TML applications to get to the next level.

Investigations that I did in 2006 showed that TMPL and SECTIONal INCLUDEs are similar, and TMPL directives can be converted into INCLUDEs via an importer.

There are some missing links to ensure the SKIN path is compatible, and presumably some interesting side effects wrt Preference evaluation, but these should be fixable.

Description and Documentation

The Template system would
  1. have a JIT cache that converts from tmpl to SECTIONal INCLUDEs
  2. The CachedIncludes system would speed up the use of SECTIONs providing a speed advantage over TMPL's
Additionally this would give us a chance to simplify and define Section names for important parts of Skins





-- Contributors: SvenDowideit - 22 Apr 2012


Please specify how view templates can be cascaded using sectional includes.

-- MichaelDaum - 23 Apr 2012

I presume you mean how TMPL:INCLUDE gets expanded to each of the Skin path elements -

if so - agreed - this is the hard bit, and why its not commited to

My current thinking involves using some variation on a stack to PUSH to the list of candidate topics onto the local scope - and then to POP them off as time goes. POP and PUSH are basically uses of %SET and i think will rely on the scope being local but persistent to the topic.

so if all uses of TMPL:P{section} are rendered as INCLUDE{"%CANDIDATES%" section="section"}

and TMPL:INCLUDE{file} becomes PUSHCANDIDATES{"view"} - which adds a list of topics based on skin path

(er, yes, i realise that I have the direction of the order wrong, but meh)

to summarise: rather than making TMPL:INCLUDE be a paste contents of a skinpath serise of files into the evaluation stack and then removing most of them, build a Skin path stack that is used to import just the sections we use.

this then creates the possibility that a skin can be evaluated using a single external store's query, after navigating the TMPL:INCLUDE stack.

(caveat - i think this might work, but won't know til we try)

-- SvenDowideit - 23 Apr 2012

Changing to discarded. No developer, and it is more experimental than ready for implementation.

-- GeorgeClark - 13 Feb 2016
Topic revision: r4 - 13 Feb 2016, GeorgeClark - This page was cached on 19 Mar 2019 - 04:05.

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