Hello
I still got a very similar Problem:
I want to create a new tiddler wich contains a) a Linklist of the actual Tiddlers b) a quite complicated expression with Macro and Formatting that I would like to extract from a templateTiddler...

So far thanks to the help of some of you I got this:
{<<clickify newTiddler
   label:"save this story!" focus:title tag:[[Tag Tag]]:Stunde
title:{{prompt('bitte geben Sie einen Namen für Ihre Zusammenstellung ein','')}}
   text:{{
      var out="";
      story.forEachTiddler(function(t){
   var tid=store.getTiddler(t);
    if(tid&&!tid.isTagged("excludeStory"))
      out+="[["+t+"]]\n";})
      out;
   }}>>
This works well.

Now I would like to ad this in the text field

'store.getTiddlerText('StoryButtonSetTemplate');

to insert two formated Buttons which allow to display the story both as a slide show and as a row of tiddlers.

Is this somehow possible?

hopefully Jan








Am 28.10.2013 18:48, schrieb Eric Shulman:
On Monday, October 28, 2013 7:36:27 AM UTC-7, Bruce Seely wrote:

    The follow-up question is how I can parametrize the macro
    invocation text?
    I'd like to be able to do the following, where the values "13456"
    and "My title text" are supplied by variables:
    <<newTiddler label:'make foo'  title:'foo-/13456/: /My title
    text/' text:'<<baz /13456/>>' >>
    I don't think assigning the variables will be difficult, but I
    can't see how to include the first variable, "13456", into the
    text parameter.
    Can store.getTiddlerText(), accept an argument that gets
    substituted in the included tiddler text?
    Or, can a value be included in the text with the evaluated
    parameters approach?


You can use all sorts of clever javascript code within an evaluated parameter to assemble a value from a combination of literals and variables.

It all depends on how your input value is stored. For simplicity, let's suppose you use the TWCore <<option txtSomeName>> syntax to enter an "option" value. Then, in the eval param javascript, you can refer to: config.options.txtSomeName to retrieve the value you entered.

Thus, you could write:

<<newTiddler label:'make foo'
   title:{{'foo-'+config.options.txtSomeName+/'/: /My title text/'}}
   text:{{'<<baz /'+/config.options.txtSomeName/+'/>>'}} >>

HOWEVER... this is still problematic... because the eval params in the <<newTiddler>> macro are calculated when the macro is *rendered*... not when it is clicked on. Thus, the param values that are used will not change if you enter a new value in the <<option txtSomeName>> input field. Fortunately, I've already solved this problem! Start by installing this plugin:
    http://www.TiddlyTools.com/#ClickifyPlugin

Then, add "clickify" to the start of your macro, like this:
<<clickify newTiddler label:'make foo'
   title:{{'foo-'+config.options.txtSomeName+/'/: /My title text/'}}
   text:{{'<<baz /'+/config.options.txtSomeName/+'/>>'}} >>

This causes the macro to recalculate the eval params each time the corresponding link (e.g., "new tiddler") is clicked, so that the params are always constructed usnig the current values of any input variables (e.g., config.options.txtSomeName).

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
   http://www.TiddlyTools.com/#Donations

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 "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to