> <div content = 'tiddler [[{{tiddler.title}} +" Nav'']]'</div>
The correct syntax for invoking this macro from a template is:
<div macro='tiddler {{tiddler.title+" Nav''}}'></div>
Breaking it apart a bit:
<div macro='...'></div>
is the template syntax for invoking a TW macro. Everything inside the
quotes is handled exactly the same as when you embed a macro in an
individual tiddler using TW syntax: a space-separated list of terms,
where the first term is the macro name, and the remaining terms are
the macro parameters
In this case, it is the "tiddler" macro which, in normal TW content is
written:
<<tiddler TiddlerName>>
and in templates, is written:
<div macro='tiddler TiddlerName'></div>
However, for your specific use-case, the macro's parameter has to be
computed dynamically, in order to construct the desired 'Nav' tiddler
title, relative to the tiddler in which the macro is being rendered.
The syntax for a computed macro parameter (aka, an "eval param") is:
<<macroName {{ ... javascript expression goes here ... }} etc>>
where the entire {{...}} sequence is treated as a single term in the
macro. Everything in between the {{ and }} is handed to your
browser's javascript engine for evaluation, and the resulting value is
then used as the value of that parameter, as if it had been typed in
as literal text.
Note: there are two 'context variables' that are automatically defined
by the TW core's macro processor so that they are available for use
within eval params: 'tiddler' is the TW 'store' object for the current
tiddler being rendered in the story column, and 'place' is the DOM
element into which the macro's output is to be rendered.
Thus, in your case, the appropriate eval param would be:
{{tiddler.title+" Nav''}}
Hope this helps...
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" 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/tiddlywiki?hl=en
-~----------~----~----~----~------~----~------~--~---