Tiddler from form fields

43 views
Skip to first unread message

Trey A

unread,
Jan 28, 2008, 12:25:00 PM1/28/08
to TiddlyWiki
Hello,

I use GTDTW 2.1.3 mostly for simple lists and geocaching (see
http://www.geocaching.com).
For geocaching, I use my hipster PDA to store info about each cache.
At the top of my
tiddler, I create a table of info about the cache, then the body of
the tiddler is the cache description.

What I do now is highlight data with the mouse on the web page and
paste in the info by hand. This is fine for one or two caches but for
10 or more, it is a pain. What I would like to do is fill out a form
with the cache's info, press a button and then my geocache card
tiddler is generated.

For example, the form would have:
Tiddler Title: _____
Waypoint name: _____
Cache Size: ____ (ideally, this would be a drop down list of sizes to
choose from)
Description: ____.

<button to create tiddler>

Then using this data from the form data, create a tiddler with the
title using the
Tiddler Title info from the form, create a table with the data from
Waypoint name
and Cache Size, and the the tiddler body would be from the
Description.

How can I do this? I'd condsider using a different TW if you have
suggestions (hopefully, this isn't a PC vs Mac flamewar spark) IF I
can move all my tiddlers to the new TW and customize my printing (ie,
use the SelectStylesheetPlugin).

tigger6333

unread,
Jan 28, 2008, 6:11:52 PM1/28/08
to TiddlyWiki
Hi Trey

I have made a tiddler to keep track of Overtime activities which you
may find useful and be able to adapt.
It does as you want, press a button and generates a tiddler from a
form which you then
just fill in the data.

When it's saved the info is then displayed in a table with previous
data listed also.

You are welcome to adapt anything for your needs.
It is available at
http://members.bbnet.com.au/~kwright/TiddlyLinks.html
just right click and save the overtime link.

Hope this helps
Cheers
Tigger

On Jan 29, 2:25 am, Trey A <Trey.Art...@yahoo.com> wrote:
> Hello,
>
> I use GTDTW 2.1.3 mostly for simple lists and geocaching (seehttp://www.geocaching.com).

Trey A

unread,
Jan 28, 2008, 7:59:20 PM1/28/08
to TiddlyWiki
On Jan 28, 6:11 pm, tigger6333 <tigger6...@gmail.com> wrote:
>
> You are welcome to adapt anything for your needs.
> It is available athttp://members.bbnet.com.au/~kwright/TiddlyLinks.html
> just right click and save the overtime link.
>
> Hope this helps
> Cheers
> Tigger
>

Thanks for the link but the Overtime link appears to be broken. I can
get to the toDo link but not the overtime one.

tigger6333

unread,
Jan 28, 2008, 9:54:37 PM1/28/08
to TiddlyWiki
Oooops sorry about that.
Now fixed.
It is available athttp://members.bbnet.com.au/~kwright/TiddlyLinks.html
just right click and save the overtime link.

Cheers
tigger

FND

unread,
Jan 29, 2008, 3:27:00 AM1/29/08
to Tiddl...@googlegroups.com

Quick note: I've noticed in your [[Overtime Management]] tiddler you use
a separate table for column headings.
You can integrate that into the FET macro call with the BEGIN parameter:
---------------
<<forEachTiddler
where
'tiddler.tags.contains("overtime")'
sortBy
'tiddler.title'
descending
write
'"|[["+tiddler.title+"]]|"+tiddler.data("timespent")+"|"
+tiddler.data("totaltime")+"|"+tiddler.data("activity")+"|\n"'
begin
'"|!Date|!hrs|!ttl|!Activity|h\n"'
>>
---------------

HTH.


-- F.

tigger6333

unread,
Jan 29, 2008, 3:54:38 AM1/29/08
to TiddlyWiki
Fantastic!
I was wondering how to do that and came up with the bodge.
Thanks FND.

I love the way this group is sooooo helpful!

Cheers
Tigg

Trey A

unread,
Jan 29, 2008, 12:31:10 PM1/29/08
to TiddlyWiki

I hate being so dense but I want something a little different than the
Overtime example. I want a tiddler that has form fields, then using
the data from the form field, create a TW formatted tiddler.

With FormTiddler, it makes the tiddler look like the form.

What would help me is an example of a tiddler with 3 input text fields
and a button. When the button is pressed, a new tiddler is created
whose name is one of the text fields. The other 2 fields are then put
in a 1x2 table (i.e., | text1 | text2 |)

I feel I have googled forever and haven't found quite what I am
looking for. Like I don't know the terminology.

tigger6333

unread,
Jan 29, 2008, 5:25:17 PM1/29/08
to TiddlyWiki
Hmmmm
The problem I can see here is that the name of the tiddler could
already
be in use. If you make a tiddler title based on one of the form
fields, what is to
stop it overwriting a tiddler already present with the same name?
You would have to have a unique name each time and that could get
tricky. That's why the overtime example uses the date and time as the
title of the
created tiddler.

I'm sure someone here has the answer. At the moment it's not me :(

Cheers
Tigger

Ken Girard

unread,
Jan 29, 2008, 7:57:37 PM1/29/08
to TiddlyWiki
Is this kind of what your looking for?
http://tiddlyforge.com/tws/geocache.html
I wanted to learn how to use a new plugin so I played around a little
last night.

(Yes, I picked up tiddlyforge.com and tiddlyforge.net. Someday maybe
we can get back tiddlyforge.org)

Ken Girard

Trey A

unread,
Jan 30, 2008, 9:48:20 AM1/30/08
to TiddlyWiki
The Geocache Wiki made me drool a little bit. I have been using GTD
for my Geocaching notebook for the last year.

I made lots of progress last night through the magic of macros and
wikify. I now have a macro which creates a tiddler in the format I
prefer for my hipster PDA. I take my hipster PDA with me
geocaching.

The macro creates a table at the top of the tiddler that has the
waypoint GCXXXX name. The waypoint name is also a link back to the
geocache page for that cache. The next item cell contains the
geocache type using the geocach icons. Next cell shows the size of
the cache using geocache icons. The table then shows difficulty and
lat/lon coords. Then the cache description is showed under the table.

My hipster is the big screen model (4x6) and the table prints nicely
on the top row.

I can post the macro if any one is interested. Is there a depository
of user developed macros?

Now, I want to create the GUI front end to call my macro.



On Jan 29, 7:57 pm, Ken Girard <ken.gir...@gmail.com> wrote:
> Is this kind of what your looking for?http://tiddlyforge.com/tws/geocache.html

Eric Shulman

unread,
Jan 30, 2008, 10:21:13 AM1/30/08
to TiddlyWiki
> 10 or more, it is a pain. What I would like to do is fill out a form
> with the cache's info, press a button and then my geocache card
> tiddler is generated.

http://www.TiddlyTools.com/#FAQ_CreateTiddlersFromForms

demonstrates a technique for using an HTML-based form to input values
and then create a new tiddler, inserting the input values into the
tiddler content (with surrounding wiki-syntax for layout formatting,
of course).

HTH,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

nathanrhale

unread,
Jan 30, 2008, 12:39:14 PM1/30/08
to TiddlyWiki
I'd like to use something similar to this to create a new
ForEachTiddlerPlugin index. For example, I'm using tiddlywiki to index
songs that my church uses in worship, as well as the orders of
service. I'd love to be able to fill out a form with the song title
in CamelCase, and then press a button to create a tiddler that shows
all the orders of service referencing that song title. Is this even
possible?

Daniel Baird

unread,
Jan 30, 2008, 4:33:45 PM1/30/08
to Tiddl...@googlegroups.com
On 1/31/08, Trey A <Trey....@yahoo.com> wrote:
[...]

> I can post the macro if any one is interested. Is there a depository
> of user developed macros?
>

Make a TiddlyWiki at tiddlyspot.com for your plugin. Make sure you
mention the version of TW you developed it in, and say what your
licensing conditions are (the BSD license is used for TW and is good
for plugins too).

Then if you never touch it again, it's still there for people to expand on.

Cheers
;Daniel

--
Daniel Baird
They say a million monkeys typing will eventually produce Shakespeare.
Thanks to commenters on YouTube, we now know this is not true.

Trey A

unread,
Jan 30, 2008, 9:02:01 PM1/30/08
to TiddlyWiki
Steven Colbert said, "Nailed it".

Thanks.

nathanrhale

unread,
Jan 30, 2008, 9:35:36 PM1/30/08
to TiddlyWiki
I've been messing around with this for a while...but I still can't
figure out how to get the content form the form fields into a
ForEachTiddler expression. Any ideas?

Eric Shulman

unread,
Jan 30, 2008, 10:19:04 PM1/30/08
to TiddlyWiki
> I've been messing around with this for a while...but I still can't
> figure out how to get the content form the form fields into a
> ForEachTiddler expression. Any ideas?

> > >http://www.TiddlyTools.com/#FAQ_CreateTiddlersFromForms

Try this...

First, create a tiddler (e.g., [[SomeTiddler]]), containing the
desired <<forEachTiddler>> macro.... BUT... wherever you want to
insert a form field value, use a "substitution marker" (%0, %1, %2,...
%9) instead of a hard-coded value.

Then, in the 'onsubmit' handler in the HTML form, replace this line:

var txt='|%0|%1|\n
%2'.format([this.field1.value,this.field2.value,this.field3.value]);

with something like:

var
txt=store.getTiddlerText("SomeTiddler","").format([this.field1.value,...]);

This line causes the content from [[SomeTiddler]] to be retrieved, and
the substitution markers it contains are then replaced by the
corresponding values from the array param passed to the format([...])
function.

nathanrhale

unread,
Jan 31, 2008, 2:30:27 AM1/31/08
to TiddlyWiki
It worked! That little line was all I needed to get started! Thanks a
ton...I'm very, very pleased with the result.

Trey A

unread,
Jan 31, 2008, 5:02:22 PM1/31/08
to TiddlyWiki
Here is what I came up with:

http://trey.arthur.tiddlyspot.com/#WebTripReport_FromFormsToGeocachingTiddlers

On Jan 30, 10:21 am, Eric Shulman <elsdes...@gmail.com> wrote:

Trey A

unread,
Feb 17, 2008, 2:34:26 PM2/17/08
to TiddlyWiki
I updated the new GeoCard to add tags.

On Jan 31, 5:02 pm, Trey A <Trey.Art...@yahoo.com> wrote:
> Here is what I came up with:
>
> http://trey.arthur.tiddlyspot.com/#WebTripReport_FromFormsToGeocachin...

Mark

unread,
Feb 17, 2008, 6:23:42 PM2/17/08
to TiddlyWiki
Hi Eric,

The FAQ_CreateTiddlersFromForms points to an interesting possibility.

Base on your example, what would the html look like for a single ISBN
field that generates a tiddler containing multiple book links?

ISBN: $1

Book Links:
[[Google Books|http://books.google.com/books?isbn=$1]] [[WorldCat|
http://worldcatlibraries.org/wcpa/isbn/$1]]
[[Amazon|http://www.amazon.com/exec/obidos/ASIN/$1]]
[[Abebooks|http://dogbert.abebooks.com/abe/BookSearch?isbn=
$1&sortby=2]]
[[Wikipedia Book sources|http://en.wikipedia.org/w/index.php?
title=Special:Booksources&isbn=$1]]

Thanks in advance.

Mark Kelly
(a TWeaked librarian)

Eric Shulman

unread,
Feb 17, 2008, 9:14:03 PM2/17/08
to TiddlyWiki
> The FAQ_CreateTiddlersFromForms points to an interesting possibility.
>
> Base on your example, what would the html look like for a single ISBN
> field that generates a tiddler containing multiple book links?

Inasmuch as you only need to substitute a single text value, I
wouldn't use the "tiddler from form" technique at all...

rather, I suggest you use 'transclusion' via the
<<tiddler TiddlerName with: param>>
syntax. In this case, start by setting up a [[BookLinks]] tiddler
containing *exactly* what you typed in your example (including the $1
'substitution marker')

[[BookLinks]]
---------------------------
ISBN: $1

Book Links:
[[Google Books|http://books.google.com/books?isbn=$1]] [[WorldCat|
http://worldcatlibraries.org/wcpa/isbn/$1]]
[[Amazon|http://www.amazon.com/exec/obidos/ASIN/$1]]
[[Abebooks|http://dogbert.abebooks.com/abe/BookSearch?isbn=
$1&sortby=2]]
[[Wikipedia Book sources|http://en.wikipedia.org/w/index.php?
title=Special:Booksources&isbn=$1]]
---------------------------

Then, to display this tiddler content with a specific ISBN number,
create another tiddler, containing:
<<tiddler BookLinks with: 1234567890>>
when this macro is rendered, it will automatically pull in the content
from [[BookLinks]] and replace each occurrence of $1 with 1234567890
(the ISBN number).

Mark

unread,
Feb 17, 2008, 11:49:54 PM2/17/08
to TiddlyWiki
Hi Eric,

Thanks for the quick response.

The transclusion via <<tiddler TiddlerName with: param>> is exactly
what I have been doing and this works fine for me.

However, I thought the TiddlerFromForms method might be friendlier for
new users who might be put off by a display of code within the
tiddler.

I'm working towards an easy to use TiddlyWiki for library users that
will facilitate their acquisition of information literacy skills.

Mark
Reply all
Reply to author
Forward
0 new messages