Hi Matabele
Than you very much :-P
I tried to create first half of a combi button which should create a
teacher and/or a task which didn't already exist - I didn't succeed ... -
have to try again when I get some more toime on my hands ..
This was my first (half) attempt:
<$reveal type="nomatch" state="!!state1" text="show">
<$mangletags tiddler={{temp!!task}} add={{temp!!teacher}}>
<$setfield message="tw-mangle-tags">
<$mangletags tiddler={{temp!!teacher}} add={{temp!!task}}
message="tw-set-field">
<$maketid title={{temp!!teacher}} tags={{temp!!task}}
message="tw-mangle-tags" edit="show">
<$iftid tiddler={{temp!!teacher}} then="tw-set-field" else="tw-new-tiddler">
<$maketid title={{temp!!task}} tags={{temp!!teacher}}
message="tw-mangle-tags" edit="show">
<$iftid tiddler={{temp!!task}} then="tw-set-field" else="tw-new-tiddler">
<$button set="!!state1" setTo="show" message="tw-if-tiddler"
param={{temp!!teacher}}>Assign/Create/Assign</$button>
</$iftid>
</$maketid>
</$iftid>
</$maketid>
</$mangletags>
</$setfield>
</$mangletags>
</$reveal>
Second half of the button should start here ...
Cheers Måns Mårtensson
Den mandag den 2. juni 2014 14.52.43 UTC+2 skrev Matabele:
>
> Hi Mans
>
> I have added a prototype of a new <$iftid> widget at:
> http://gwiz.tiddlyspot.com/
>
> This widget tests for the existence of a specified tiddler, then sends
> alternate messages to the stack depending upon whether this tiddler exists.
> I'm not sure if the messaging is all OK, but seems to work in simple cases.
> if the test is true and you have nothing further to do -- send a dummy
> message as the value for the 'then=' attribute to prevent spurious messages
> flying around. In the case that the tiddler does not exist, send a
> "tw-new-tiddler" message (the default) as the value of the 'else='
> attribute, and add a <$maketid> widget to create your new tiddler (the
> title for the new tiddler must be specified in the <$maketid> widget.)
>
> Give the widget a try for your application.
>
> regards
>
> On Sunday, June 1, 2014 8:20:23 PM UTC+2, Matabele wrote:
>>
>> Hi Mans
>>
>> OK - I have an idea for a new widget -- should solve your problem whilst
>> helping out with my messaging problem in the stack.
>>
>> Give me a little time as the change will likely mean I have to modify my
>> other widgets a little to make them compatible.
>>
>> regards
>>
>> On Sunday, June 1, 2014 2:55:10 PM UTC+2, Måns wrote:
>>>
>>> Hi Matabele
>>>
>>>>
>>>> Now I'd love to combine <$mangletags> with <$maketid> via
>>> <$edit-text tiddler="temp" field="teacher"/> &
>>> <$edit-text tiddler="temp" field="task"/> so it would:
>>>
>>> 1) create a new task tiddler *only* if it doesn't already exist.
>>> 2) create a new teacher tiddler *only* if it doesn't already exist.
>>>
>>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.