Creating new tiddler with titles set by multiple selects

230 views
Skip to first unread message

SteveSchneider DesignWriteX

unread,
Aug 1, 2016, 4:37:16 PM8/1/16
to TiddlyWiki
(this was discussed in this thread: https://groups.google.com/forum/?hl=en#!searchin/tiddlywiki/x-maketid%7Csort:relevance/tiddlywiki/FQE6CEX03Jk/rqdQmdLjBQAJ)

I've successfully created new tiddlers with titles set to the concatenated results of two selects. However, it takes me four clicks (including deleting a temporary tiddler).

Here is my implementation: https://dl.dropbox.com/s/ep3i0ylqxx8btxx/naming-a-new-tiddler.html?dl=0

Any ideas of how to reduce the number of clicks (ideally, to one button).

Thanks!

//steve.

Here's the code:
* Objective: Create a new tiddler with the name derived from two selects, with fewer than four clicks
* Requires: maketid plugin from http://gwiz-beta.tiddlyspot.com/#
<hr>
<$button>
<$action-deletetiddler $tiddler="$:/temp1"/>
<$action-deletetiddler $tiddler="$:/temp2"/>
One - delete temporary tiddlers
</$button>

Color: <$select tiddler='$:/
temp1'>
<option>Red</option>
<option>Blue</option>
<option>Green</option>
</$select>

Vehicle: <$select tiddler='
$:/temp2'>
<option>Truck</
option>
<option>Sedan</option>
<option>Convertible</
option>
</$select>


<$button>
<$x-maketid  $title="Temporary"  
tiddlertitle={{$:/
temp1}} $navigate="hide"/>
Two - create temporary tiddler and field:tiddlertitle
</$button>
<$button>
<$action-listops $tiddler="Temporary" $field="tiddlertitle" $subfilter={{$:/
temp2}}/>
Three - append value to temporary field
</$button>
<$button>
<$x-maketid $title={{Temporary!!tiddlertitle}}  tags="ColorVehicles"  /
>
<$action-deletetiddler $tiddler="Temporary"/>
Four - create desired tiddler with tags, delete temporary tiddler
</$button>



Mark S.

unread,
Aug 1, 2016, 5:53:45 PM8/1/16
to TiddlyWiki
Why do you need the temporary and invisible tiddlers to be deleted? I'm not sure that you need a 3rd party widget any more. New stuff has been added to TW5. Here's my code that leaves the temporary tiddlers hanging around but does it in one click. It might be possible to delete the temporary tiddlers as part of the process, but what is the use case? You're just going to need them again, right?

-- Mark

\define newtitle() $(color)$-$(model)$
Color: <$select tiddler='$:/temp1'>
<option>Red</option>
<option>Blue</
option>
<option>Green</option>
</
$select>

Vehicle: <$select tiddler='$:/temp2'>
<option>Truck</option>
<option>Sedan</
option>
<option>Convertible</option>
</
$select>

<$set name=color value={{$:/temp1}}>
<$set name=model value={{$:/
temp2}}>

<$button>Make new tiddler
<$action-setfield $tiddler=<<newtitle>> tags="ColorVehichle" />
<$action-navigate $to=<<newtitle>>/>
</
$button>

</$set>
</
$set>

DesignWriteX SteveSchneider

unread,
Aug 3, 2016, 11:07:16 AM8/3/16
to tiddl...@googlegroups.com
Thanks, Mark, that did the trick. The \define newtitle() $(color)$-$(model)$ code is new to me; I'll find that very helpful (and, I'll add, is nicely documented at http://tiddlywiki.com/#Macros,

//steve.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/LtMpKgnGO68/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/0de17562-07f6-46bb-9a97-8a198b9ca211%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
DesignWriteX is the administrative account for {{DesignWrite}}, the Designing and Writing Interactive Texts learning community.

Coordinator: Steve Schneider, st...@sunyit.edu

Danielo Rodríguez

unread,
Aug 3, 2016, 1:27:23 PM8/3/16
to TiddlyWiki
Mark, if you use $:/state/ as a prefix of the temp tiddlers they will not be saved and you will get garbage collection for free.

Regards

Reply all
Reply to author
Forward
0 new messages