NewTiddlerWithFormMacro

154 views
Skip to first unread message

Hal

unread,
Aug 16, 2011, 10:48:53 AM8/16/11
to TiddlyWiki
I am using abego extension newTiddlerWithFormMacro. I would like the
newly created macro to have a tag when it is created. Following his
example in the info section of the plugin, I created this:

<<newTiddlerWithForm
FormTemplate
"New Account"
'"New Account Name"' askUser
>>

That works. It creates a dialog box that prompts the user to alter the
title and then creates the new tiddler. But I don't see how to add a
tag. The user would then have to edit the newly created tiddler and
add the tag. That will not work for my purposes.

If I use the newTiddler macro rather than the newTiddlerWithForm macro
to create a new tiddler following this example in the macro info
section:

<<newTiddler
label:"Button Label"
text:{{"<<formTiddler [[MyTemplateTiddler]]>"+">"}}
tag:"MyTag1"
tag:"Three Word Tag"
>>

That also works. And it embeds the tag into the new tiddler. But it
creates the tiddler directly, rather than through the dialog box. The
user then has to edit the title and click "done." I'd rather avoid
that as well.

I would prefer the dialog box BUT to have the tag embedded into the
new tiddler. Is there a way to do that?

Thanks,
Hal

Måns

unread,
Aug 16, 2011, 6:44:47 PM8/16/11
to TiddlyWiki
Hi Hal

> <<newTiddlerWithForm
>  FormTemplate
>  "New Account"
>  '"New Account Name"' askUser>>

> <<newTiddler
>         label:"Button Label"
>         text:{{"<<formTiddler [[MyTemplateTiddler]]>"+">"}}
>         tag:"MyTag1"
>         tag:"Three Word Tag">>

I think we've all been there a few times - "The missing tag-feature"
of the newTiddlerWithForm macro is really annoying - and makes it
completely useless if you want to exploit the great features of
HideWhenPlugin or TiddlyTweakerPlugin...

TwabPlugin http://www.tiddly-twab.com/#TwabPlugin solves the problem
to some extent, however it needs inlineJavascriptPlugin- and I can't
figure out how to create a newTiddlerWithForm macro from looking at
it's code..

Another pretty anoying thing is the fact that htmlforms are not
refreshed/rendered when you use the tabmacro <<tab ... >> This is a
serious obstacle if you want to use htmlforms in a TW...

Sorry I could not provide a reasonable workaround. Good luck!!

Cheers Måns Mårtensson

Hal

unread,
Aug 18, 2011, 1:37:47 PM8/18/11
to TiddlyWiki
Mans,

Thanks for your response--even if it wasn't the one I was hoping for.

I wanted to be able to group the newly created tiddlers by tags. I'll
have to explore forEachTiddler further to see if I can aggreated them
that way.

I'm not using any htmlforms in tabs, so I haven't run into that
problem.

Thanks,
Hal

On Aug 16, 6:44 pm, Måns <humam...@gmail.com> wrote:
> Hi Hal
>
> > <<newTiddlerWithForm
> >  FormTemplate
> >  "New Account"
> >  '"New Account Name"' askUser>>
> > <<newTiddler
> >         label:"Button Label"
> >         text:{{"<<formTiddler [[MyTemplateTiddler]]>"+">"}}
> >         tag:"MyTag1"
> >         tag:"Three Word Tag">>
>
> I think we've all been there a few times - "The missing tag-feature"
> of the newTiddlerWithForm macro is really annoying - and makes it
> completely useless if you want to exploit the great features of
> HideWhenPlugin or TiddlyTweakerPlugin...
>
> TwabPluginhttp://www.tiddly-twab.com/#TwabPluginsolves the problem

cmari

unread,
Aug 18, 2011, 3:14:50 PM8/18/11
to tiddl...@googlegroups.com
Hi Hal,
Perhaps what you're looking for could be accomplished with NewSavedTiddlerPlugin:
http://mgsd.tiddlyspot.com/demo3.html#NewSavedTiddlerPlugin

I think that should allow you to do something like:
<<newSavedTiddler
        label:"Button Label"
        text:{{store.getTiddlerText('MyTemplateTiddler')}}
        tag:'MyTag1 [[Three Word Tag]]'
>>

cmari

Hal

unread,
Aug 19, 2011, 9:54:53 AM8/19/11
to TiddlyWiki
cmari,

Bingo!! That's exactly what I need. Thanks so much for bringing that
plugin to my attention.

The whole mgsd demo is fascinating. I'll have to spend some time
studying it.

Thanks,
Hal

anton....@antonaylward.com

unread,
Oct 21, 2013, 3:38:50 PM10/21/13
to tiddl...@googlegroups.com
That works ... but I wonder if its possible for fill in the fields in the form

I have a 'Character' template and the title should correspond to first name + second name.

Jan Johannpeter

unread,
Oct 23, 2013, 4:09:20 PM10/23/13
to tiddl...@googlegroups.com
Yuppie!
This seems to bring me close to solve a problem I have longed for so
much time...
I want ot create a tiddler wich creates a tiddler containig the actual
story including a button to open the story contained with the story
saver plugin...
I imagine this could be usefull very for a lot of people...

I used this famous newSavedTiddlerPlugin >
http://mgsd.tiddlyspot.com/demo3.html#NewSavedTiddlerPlugin

Creating a macrobutton:
<<newSavedTiddler
label:"Save this Story"
text:{{store.getTiddlerText('SaveStoryTemplateTiddler')}}
tag:'MyTag1 [[Three Word Tag]]'
>>
...and a SaveStoryTemplateTiddler

<script>
var out = "" ;
story.forEachTiddler(function(t){
var tid=store.getTiddler(t);
if(tid&&!tid.isTagged("excludeStory"))
out+="[["+t+"]]\n";})
return out ;
</script>
<<openStory {{tiddler.title}} "Open this Story" "Display all the
tiddlers listed above...">>

Now here is the remainig problem:
The script should be rendered to save the current storyline, not to
display the one actually opened on a later moment.
How do I accomplish this.

Is there something like "clickyfy" for this cause...?

Hopefully Jan

Tobias Beer

unread,
Oct 30, 2013, 3:14:54 PM10/30/13
to tiddl...@googlegroups.com
The script should be rendered to save the current storyline, not to
display the one actually opened on a later moment.
How do I accomplish this.

Is there something like "clickyfy" for this cause...?

Hopefully Jan


Rather than fetching the tiddler text being the script, I believe you rather want to run that script in the context of your newSavedTiddler macro call.

So, the solution would look something like this (untested)...

<<newSavedTiddler label:"Save this Story"
text:{{
var out = "";
story.forEachTiddler(function(t){
   
var tid=store.getTiddler(t);
       
if(tid&&!tid.isTagged("excludeStory"))
           
out+="[["+t+"]]\n";
})
out;}}
tag:'MyTag1 [[Three Word Tag]]'
>>

Tobias.

Eric Shulman

unread,
Oct 30, 2013, 3:38:22 PM10/30/13
to tiddl...@googlegroups.com
On Wednesday, October 30, 2013 12:14:54 PM UTC-7, Tobias Beer wrote:
The script should be rendered to save the current storyline, not to
display the one actually opened on a later moment.
How do I accomplish this.

Try this:

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:

Jan Johannpeter

unread,
Oct 30, 2013, 4:44:49 PM10/30/13
to tiddl...@googlegroups.com
Hello Eric, hello Tobias,
 thanks for your answers. I just read them for my mailclient fetched them too slowly and so I already had posted a new request under the title "Merging a function an a template into one new Tiddler"
Your solutions both work well for the first part of my problem but it is a little more complex, for i want two ad two (formated) buttons to open the story in the tiddler created.
Eric, perhaps it would be an Idea to fit in the option to create a button that will automatically open the contained story in the storyTiddler created by your storySaverPlugin. Somthing like <<openStory {{tiddler.title}} "Open this Story">>

Here is post describing the problem.

Hello
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 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 an produces a tiddler containing links to all Tiddlers open at that moment.

Now I would like to ad somthing lig this this in the text field

'store.getTiddlerText('StoryButtonSetTemplate');

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

Is this somehow possible?

hopefully Jan
--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

Tobias Beer

unread,
Oct 30, 2013, 4:46:23 PM10/30/13
to tiddl...@googlegroups.com
Or that ;-)

To be precise, I guess what you are implying is to use the saveStory macro, correct?

Tobias.
Reply all
Reply to author
Forward
0 new messages