Hi MJL,

> My question is the same one that has bee asked for years now: How do I
> invoke a tiddler populated with text, controls, etc?  Hopefully there
> is a generally recognized standard for this?

mario addressed the basics of macro invocation in his reply, so I'm
just going to respond to the specific question you asked - how to 'pre-
populate' tiddler content when creating a new tiddler (which, btw, has
been answered *many* times over the years...)

The <<newTiddler>> macro has optional parameters tht allow you to
define initial values for the title, tags, text and custom fields of a
tiddler.  For your purposes, the parameter you want is "text:..."

   <<newTiddler text:"this is the default text for the new tiddler">>

Unfortunately, the macro syntax is a bit restrictive when specifying
text: it must be enclosed in either single- or double-quotes (which
means you can't use BOTH within the text), and cannot contain TW
macros (the closing ">>" within the text would break the surrounding
macro definition!).  Also, if the default text is lengthy (or multi-
line), it can become ridiculously difficult to read and understand the
nesting of syntax within the surrounding macro.

Fortunately, there is simple method of specifying the text that avoids
the ugliness: first store the desired default text in a separate
tiddler (e.g., [[SomeTiddler]]) and then retrieve that tiddler content
for use as the value of a macro param, by using the *evaluated
parameter* syntax to invoke the TWCore's store.getTiddlerText()
function, like this:

   <<newTiddler text:{{store.getTiddlerText("SomeTiddler")}}>>

The result is that the contents of SomeTiddler are pre-loaded into the
text field of the new tiddler when it is initialized for editing.
QED.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

----
WAS THIS ANSWER HELPFUL?  IF SO, PLEASE MAKE A DONATION
   http://www.TiddlyTools.com/#Donations
note: donations are directly used to pay for food, rent,
gas, net connection, etc., so please give generously and often!

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
   http://www.TiddlyTools.com/#Contact

-- 
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