I would like to request a macro to transclude a tiddler with a
specified, custom template.

Worked example:
Suppose I have created a template called minimalViewTemplate which
looks like
<div class='content'>
<div class='viewer' macro='view modifier text'></div>
<div class='viewer' macro='view text wikified'></div>
</div>

I now want to transclude a tiddler T (with modifier 'rolf' and text
'Hello World' say) in a tiddler S, but so that T is displayed using
the minimalViewTemplate.
Say the text of S looks like
Some text.
<<tiddler T template:minimalViewTemplate>>
Some more text.

S should then be rendered (using the default ViewTemplate) as
...(header etc)...
Some text.
   rolf
   Hello World
Some more text.
...(footer etc)...

A solution (I've more or less implemented this as a plugin giving rise
to a new macro <<tiddlerWithTemplate...>>):
* in the current implementation of config.macros.tiddler.handler check
for the template parameter and pass it along to
config.macros.tiddler.transclude (with a null value if no template has
been specified). Also in config.macros.tiddler.transclude simply pass
the template paramater along to config.macros.tiddler.renderText.
* in config.macros.tiddler.renderText check whether template is null.
If yes, do the current wikify command. If not set place.innerHtml to
store.getTiddlerText(template) (and possibly adjust the attributes of
place as in story.prototype.refreshTiddler) and call
applyHtmlMacros(place,store.getTiddler(tiddlerName)).
* Give the same treatment to the 'slider' macro.
Best wishes,
Rolf

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to