[TW5] tm-new-tiddler

1,013 views
Skip to first unread message

Stephan Hradek

unread,
Nov 12, 2014, 11:13:57 AM11/12/14
to tiddl...@googlegroups.com
I just wanted to create a small input form. I tlooks something like this:

|!Username |<$edit-text tiddler="$:/temp/newuser" placeholder="username" tag="input" type="text"/> |
|!First Name |<$edit-text tiddler="$:/temp/newuser" field="firstname" placeholder="first name" tag="input" type="text"/> |
|!Last Name |<$edit-text tiddler="$:/temp/newuser" field="lastname" placeholder="last name" tag="input" type="text"/> |
|!E-Mail |<$edit-text tiddler="$:/temp/newuser" field="email" placeholder="e-mail address" tag="input" type="text"/> |
|!sometags |<$checkbox... /example shortened/

So when I fill these fields, I'm supposed to get a tiddler "$:/temp/newuser" where names and e-mail are stored in fields and the text is the user's username:

title: $:/temp/newuser
tags
: some tags which were set
text
: Skeeve
firstname
: Stephan
lastname
: hradek
email
: witheld

Now I wanted to create a button which would create from this a tiddler titled "Skeeve" and has all the fields and tags of the temporary folder.

I can't imagine how to safely do that.

When I use a skeleton tiddler for the tm-new-tiddler I can't change the title.

When I use a hashmap as param, I think the whole thing could fail because of quoting. What if a user used a " in some input value?

Any ideas anyone?

Danielo Rodríguez

unread,
Nov 12, 2014, 11:32:16 AM11/12/14
to tiddl...@googlegroups.com
There is no way to do this in 5.1.4 without widgets, trust me I tried very hard.

When action-set-field widget comes in it will be easier.

Regards.

Jeremy Ruston

unread,
Nov 12, 2014, 12:05:11 PM11/12/14
to TiddlyWiki
Hi Stephan

One of the changes in 5.1.5 is that the tm-new-tiddler message now lets you specify both the title of a template tiddler and any number of additional fields. So you can do things like this:

<$action-sendmessage $message="tm-new-tiddler" $template="$:/temp/newuser" title={{myTitleTiddler}}/>

Best wishes

Jeremy.


--
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/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Stephan Hradek

unread,
Nov 12, 2014, 12:50:28 PM11/12/14
to tiddl...@googlegroups.com


Am Mittwoch, 12. November 2014 17:32:16 UTC+1 schrieb Danielo Rodríguez:
There is no way to do this in 5.1.4 without widgets, trust me I tried very hard.

Actually: I found a way!

<$button set="$:/temp/newuser!!title" setTo={{$:/temp/newuser!!title}}">...

If anyone's interested, I can show the full stuff later.

Danielo Rodríguez

unread,
Nov 12, 2014, 1:03:26 PM11/12/14
to tiddl...@googlegroups.com
Looks like a bug.😄

I think I got something similar, much more twisted and less cleaner. Does that change the tiddler tittle or creates a new one? A clone maybe?

Felix Küppers

unread,
Nov 12, 2014, 1:06:51 PM11/12/14
to tiddl...@googlegroups.com

<$button set="$:/temp/newuser!!title" setTo={{$:/temp/newuser!!title}}">...


This is just crazy! :) I never thought about that

Stephan Hradek

unread,
Nov 12, 2014, 2:03:23 PM11/12/14
to tiddl...@googlegroups.com


Am Mittwoch, 12. November 2014 18:50:28 UTC+1 schrieb Stephan Hradek:


Am Mittwoch, 12. November 2014 17:32:16 UTC+1 schrieb Danielo Rodríguez:
There is no way to do this in 5.1.4 without widgets, trust me I tried very hard.

Actually: I found a way!

<$button set="$:/temp/newuser!!title" setTo={{$:/temp/newuser!!title}}">...

There's a quote too much. <$button set="$:/temp/newuser!!title" setTo={{$:/temp/newuser!!
title}}>...

Stephan Hradek

unread,
Nov 12, 2014, 2:05:10 PM11/12/14
to tiddl...@googlegroups.com


Am Mittwoch, 12. November 2014 19:03:26 UTC+1 schrieb Danielo Rodríguez:
Looks like a bug.😄

I think I got something similar, much more twisted and less cleaner. Does that change the tiddler tittle or creates a new one? A clone maybe?

It clones the $:/temp/newuser tiddler.

Danielo Rodríguez

unread,
Nov 12, 2014, 2:20:07 PM11/12/14
to tiddl...@googlegroups.com
But with the same name, not with skeeve as title.

Stephan Hradek

unread,
Nov 12, 2014, 2:35:29 PM11/12/14
to tiddl...@googlegroups.com


Am Mittwoch, 12. November 2014 20:20:07 UTC+1 schrieb Danielo Rodríguez:
But with the same name, not with skeeve as title.

???

Just try it. Ready to be pasted to tiddlywiki.com:

|!Username |<$edit-text tiddler="$:/temp/newuser" placeholder="username" tag="input" type="text"/> |
|!First Name |<$edit-text tiddler="$:/temp/newuser" field="firstname" placeholder="first name" tag="input" type="text"/> |
|!Last Name |<$edit-text tiddler="$:/temp/newuser" field="lastname" placeholder="last name" tag="input" type="text"/> |
|!E-Mail |<$edit-text tiddler="$:/temp/newuser" field="email" placeholder="e-mail address" tag="input" type="text"/> |
|!sometags |<$checkbox tiddler="$:/temp/newuser" tag="Admin"> Admin</$checkbox><br/><$checkbox tiddler="$:/temp/newuser" tag="cron"> cron</$checkbox><br/><$checkbox tiddler="$:/temp/newuser" tag="www"> www</$checkbox> |

<$reveal type="nomatch" text="" state="$:/
temp/newuser">
  <$button set="
$:/temp/newuser!!title" setTo={{$:/temp/newuser}}>
    <$reveal type="
match" text={{$:/temp/newuser}} state={{$:/temp/newuser}}>
      Modify
    </$reveal>
    <$reveal type="
nomatch" text={{$:/temp/newuser}} state={{$:/temp/newuser}}>
      Create
    </$reveal>
  </$button>
</$reveal>

 

Stephan Hradek

unread,
Nov 12, 2014, 2:37:38 PM11/12/14
to tiddl...@googlegroups.com
Please note the label of the Modify/Create button ;)

Sylvain Naudin

unread,
Nov 12, 2014, 2:38:04 PM11/12/14
to tiddl...@googlegroups.com


Le mercredi 12 novembre 2014 18:50:28 UTC+1, Stephan Hradek a écrit :

If anyone's interested, I can show the full stuff later.

Hi, yes I'm interested :)

I think about a similar need to have a timesheet when I organized workshop. So I could have a form like this to register member, and list them on a tiddler entry (like journal maybe) when there are in the classroom.

Sylvain

Stephan Hradek

unread,
Nov 12, 2014, 2:48:24 PM11/12/14
to tiddl...@googlegroups.com


Am Mittwoch, 12. November 2014 20:38:04 UTC+1 schrieb Sylvain Naudin:


Le mercredi 12 novembre 2014 18:50:28 UTC+1, Stephan Hradek a écrit :

If anyone's interested, I can show the full stuff later.

Hi, yes I'm interested :)

I already posted it some minutes ago.

But here's an enhanced version:

\define theTiddler() $(the_tiddler)$!!title

|!Username |<$edit-text tiddler="$:/temp/newuser" placeholder="username" tag="input" type="text"/> |
|!First Name |<$edit-text tiddler="$:/temp/newuser" field="firstname" placeholder="first name" tag="input" type="text"/> |
|!Last Name |<$edit-text tiddler="$:/temp/newuser" field="lastname" placeholder="last name" tag="input" type="text"/> |
|!E-Mail |<$edit-text tiddler="$:/temp/newuser" field="email" placeholder="e-mail address" tag="input" type="text"/> |
|!sometags |<$checkbox tiddler="$:/temp/newuser" tag="Admin"> Admin</$checkbox><br/><$checkbox tiddler="$:/temp/newuser" tag="cron"> cron</$checkbox><br/><$checkbox tiddler="$:/temp/newuser" tag="www"> www</$checkbox> |

<$reveal type="nomatch" text="" state="$:/
temp/newuser
">
  <$reveal type="
match" text={{$:/temp/newuser}} state={{$:/temp/newuser}}>
    <$button set="
$:/temp/newuser!!title" setTo={{$:/temp/newuser}}>
      Modify
    </$button>
    <$set name="
the_tiddler" value={{$:/temp/newuser}}>
    <$button setTo="
$:/temp/newuser" set=<<theTiddler>>>
      Fetch
    </$button>
    </$set>
  </$reveal>
  <$reveal type="
nomatch" text={{$:/temp/newuser}} state={{$:/temp/newuser}}>
    <$button set="
$:/temp/newuser!!title" setTo={{$:/temp/newuser}}>
      Create
    </$button>
  </$reveal>
</$reveal>

 Let's hope it's not a bug!

Danielo Rodríguez

unread,
Nov 12, 2014, 3:15:02 PM11/12/14
to tiddl...@googlegroups.com
Hello Stephan,

Please note that you first posted:

<$button set="$:/temp/newuser!!title" setTo={{$:/temp/newuser!!title}}">


Which will set the tittle vale of the temp tiddler to the title field of the temp tiddler, which should be exactly the same. In the new versions you have posted there is a different approach and you are using the TEXT field, not the tittle. That's why it looks so weird to me.

Your new version is very elegant and useful, but It's not new. In fact, I reminds me to some of your own customizations.

Stephan Hradek

unread,
Nov 12, 2014, 3:19:55 PM11/12/14
to tiddl...@googlegroups.com


Am Mittwoch, 12. November 2014 21:15:02 UTC+1 schrieb Danielo Rodríguez:
Hello Stephan,

Please note that you first posted:

<$button set="$:/temp/newuser!!title" setTo={{$:/temp/newuser!!title}}">

Thanks for that! Didn't really notice. I already switched off the computer where I had the working version and just typed it from memory, not testing it.
 
Your new version is very elegant and useful, but It's not new.
 
It's not new? Why didn't anyone tell me that I can use that? 

In fact, I reminds me to some of your own customizations.

Hmm… Am I getting old? (I do hope so) Already? (maybe)… I can't remember I did something similar before. But then: I think I already did some crazy stuff with TW5 before :D

Sylvain Naudin

unread,
Nov 12, 2014, 3:26:37 PM11/12/14
to tiddl...@googlegroups.com
It's pretty awesome ! I just test and it's work like a charm, even on prerelease too.

Maybe for Danielo it's not new, but for me yes :)

Thanks for sharing this tips.
Sylvain

Danielo Rodríguez

unread,
Nov 12, 2014, 3:33:25 PM11/12/14
to tiddl...@googlegroups.com

Thanks for that! Didn't really notice. I already switched off the computer where I had the working version and just typed it from memory, not testing it.
 
That explains why you blow my mind.
 
 
It's not new? Why didn't anyone tell me that I can use that? 

Maybe is my memory which is going bad and I'm turning new things into memories?
 

Hmm… Am I getting old? (I do hope so) Already? (maybe)… I can't remember I did something similar before. But then: I think I already did some crazy stuff with TW5 before :D


I have to agree with the last part. I'm still guessing HOW the reveal button detects when the referenced tiddler have been created with your form and when it is an already existing non-related tiddler.  The fetch button is also  blowing my mind:

    <$set name="the_tiddler" value={{$:/temp/newuser}}>
    <$button setTo="$:/temp/newuser" set=<<theTiddler>>>
      Fetch
    </$button>
    </$set>


It sets the title of "the tiddler" (good name since is some kind of limbo tiddler) to the value that is contained on the text field of the temp tiddler. But it is not actually setting the title because the tiddler already exist, and it is setting it to the same title, but this makes the tiddler get into the form instead of creating a new tiddler with empty fields o_0 I can't understand it! It's like setting an unexisting tiddler's title to the title of an existing tiddler that turns that unexisting tiddler in the already existing one instead of turning the already existing tiddler into the unexisting tiddler aaahahahahahahah

Sylvain Naudin

unread,
Nov 12, 2014, 3:41:21 PM11/12/14
to tiddl...@googlegroups.com
Well I don't understand Fetch button use. What is his purpose ?

Sylvain

Stephan Hradek

unread,
Nov 12, 2014, 3:54:11 PM11/12/14
to tiddl...@googlegroups.com


Am Mittwoch, 12. November 2014 21:41:21 UTC+1 schrieb Sylvain Naudin:
Well I don't understand Fetch button use. What is his purpose ?

For this use case imagine I've already created my account "Skeeve" using the form.

If I come back later, typing "Skeeve" into the Username, I will be able to set new values, but the current values won't appear in the form unless I press "Fetch". So this is a way to retrieve the values which are already set in my "Skeeve"-tiddler.

Danielo Rodríguez

unread,
Nov 12, 2014, 4:11:38 PM11/12/14
to tiddl...@googlegroups.com
But that does not explains how it works, if it is even possible to explain .....

Sylvain Naudin

unread,
Nov 12, 2014, 4:16:22 PM11/12/14
to tiddl...@googlegroups.com


Le mercredi 12 novembre 2014 21:54:11 UTC+1, Stephan Hradek a écrit :
For this use case imagine I've already created my account "Skeeve" using the form.

If I come back later, typing "Skeeve" into the Username, I will be able to set new values, but the current values won't appear in the form unless I press "Fetch". So this is a way to retrieve the values which are already set in my "Skeeve"-tiddler.

Hum... you explanation sounds correct for me, but I can't see in action :/

Maybe I miss something on my tiddler. Should I add a specific tag system ?

Can you add a clear form button ? I don't know how I could do.

Stephan Hradek

unread,
Nov 12, 2014, 4:25:24 PM11/12/14
to tiddl...@googlegroups.com


Am Mittwoch, 12. November 2014 22:16:22 UTC+1 schrieb Sylvain Naudin:
Maybe I miss something on my tiddler. Should I add a specific tag system ?

Add some information into the fields.
Click create.

Change some of the information, but not the Username.

Click "Fetch" and the values you just changed should revert to the values you saved before, when creating the user-tiddler.
 
Can you add a clear form button ? I don't know how I could do.

<$button message="tm-delete-tiddler" param="$:/temp/newuser">Clear</$button>

But this would prompt for confirmation. Don't know how to avoid that.

Stephan Hradek

unread,
Nov 12, 2014, 4:27:04 PM11/12/14
to tiddl...@googlegroups.com


Am Mittwoch, 12. November 2014 22:11:38 UTC+1 schrieb Danielo Rodríguez:
But that does not explains how it works, if it is even possible to explain .....

The fetch button sets the title of the "Skeeve" tiddler to "$:/temp/newuser", thus overwriting all the fields of the current $:/temp/newuser. This triggers a refresh of the form which will then show the values which were just written to the temp tiddler.

Sylvain Naudin

unread,
Nov 12, 2014, 5:46:39 PM11/12/14
to tiddl...@googlegroups.com


Le mercredi 12 novembre 2014 22:25:24 UTC+1, Stephan Hradek a écrit :
Add some information into the fields.
Click create.

Change some of the information, but not the Username.

Click "Fetch" and the values you just changed should revert to the values you saved before, when creating the user-tiddler.

No sorry, it doesn't work for me. I don't see anything change in values of my tiddlers.


 
 Can you add a clear form button ? I don't know how I could do.

<$button message="tm-delete-tiddler" param="$:/temp/newuser">Clear</$button>

But this would prompt for confirmation. Don't know how to avoid that.

Thanks :)

Birthe C

unread,
Nov 12, 2014, 7:16:28 PM11/12/14
to tiddl...@googlegroups.com
Hi Stephan

Thank you so much for this and for your explanation. I had hoped for something like this. It works well for me.


Birthe

Stephan Hradek

unread,
Nov 13, 2014, 12:52:00 AM11/13/14
to tiddl...@googlegroups.com



Am Mittwoch, 12. November 2014 23:46:39 UTC+1 schrieb Sylvain Naudin:


No sorry, it doesn't work for me. I don't see anything change in values of my tiddlers.

No! Not the tiddlers change when you "Fetch", the FORM content changes.



Sylvain Naudin

unread,
Nov 13, 2014, 2:36:38 AM11/13/14
to tiddl...@googlegroups.com


Le jeudi 13 novembre 2014 06:52:00 UTC+1, Stephan Hradek a écrit :

No sorry, it doesn't work for me. I don't see anything change in values of my tiddlers.

No! Not the tiddlers change when you "Fetch", the FORM content changes.


So it still doesn't work for me :( Last I speak about tiddler because nothing change on form to retrieve content.. I don't see where I'm wrong, because it work for (thanks for print screen) you and Birthe.
Can you share a tw5.html somewhere please ?

Thanks and sorry again.
Sylvain

Stephan Hradek

unread,
Nov 13, 2014, 2:46:57 AM11/13/14
to tiddl...@googlegroups.com
I don't have an up-to-date tiddlyspot. All are outdated beta versions a.t.m.

Can you share your non-working experiment? Are you on the latest TW5 version?

Sylvain Naudin

unread,
Nov 13, 2014, 3:10:27 AM11/13/14
to tiddl...@googlegroups.com

2014-11-13 8:46 GMT+01:00 Stephan Hradek <stephan...@gmail.com>:
I don't have an up-to-date tiddlyspot. All are outdated beta versions a.t.m.

Can you share your non-working experiment? Are you on the latest TW5 version?


I try on tiddlywiki.com with 5.1.4 and preview 5.1.5 and on my file 5.1.4.

PMario

unread,
Nov 13, 2014, 3:11:23 AM11/13/14
to tiddl...@googlegroups.com
@Sylvian
Do you use the latest snippet from Skeeve?
Just to be sure.
-m

Sylvain Naudin

unread,
Nov 13, 2014, 3:29:05 AM11/13/14
to tiddl...@googlegroups.com
I think yes..

(by the way Mario, my first name is Sylvain, not Sylvian, even I like this new label :D)

Birthe C

unread,
Nov 13, 2014, 3:30:26 AM11/13/14
to tiddl...@googlegroups.com
Hi Sylvain
The same thing happened to me, when I first copied and pasted. Look at your code, you have a linebreak


<$button setTo="$:/temp/newuser
" set=<<theTiddler>>>

<$button setTo="$:/temp/newuser" set=<<theTiddler>>>

After I corrected that in my TW...it worked.


Birthe

Sylvain Naudin

unread,
Nov 13, 2014, 3:40:56 AM11/13/14
to tiddl...@googlegroups.com


2014-11-13 9:30 GMT+01:00 Birthe C <strikke...@googlemail.com>:
Hi Sylvain
The same thing happened to me, when I first copied and pasted. Look at your code, you have a linebreak

<$button setTo="$:/temp/newuser
" set=<<theTiddler>>>

<$button setTo="$:/temp/newuser" set=<<theTiddler>>>

After I corrected that in my TW...it worked.


Birthe


Many thanks Birthe, you're found my issue !! It work's now.

Stephan Hradek

unread,
Nov 13, 2014, 3:46:20 AM11/13/14
to tiddl...@googlegroups.com
Thanks for spotting it, Birthe.

PMario

unread,
Nov 13, 2014, 4:50:52 AM11/13/14
to tiddl...@googlegroups.com
On Thursday, November 13, 2014 9:29:05 AM UTC+1, Sylvain Naudin wrote:
(by the way Mario, my first name is Sylvain, not Sylvian, even I like this new label :D)

Uups, sorry about that :)
-m

Stephan Hradek

unread,
Nov 13, 2014, 4:57:39 AM11/13/14
to tiddl...@googlegroups.com


I still would like to see your avatar be changed to that ^ or something similar :D

 

Tobias Beer

unread,
Nov 14, 2014, 5:04:00 AM11/14/14
to tiddl...@googlegroups.com
Thanks a lot, Stephan!

I think that's quite a prominent candidate for tw5magick ...if that's what you use it for.

Best wishes, Tobias.

Danielo Rodríguez

unread,
Nov 14, 2014, 5:17:39 AM11/14/14
to tiddl...@googlegroups.com
@Stephan,

Sorry for insisting this, but one of the questions that I previously made still driving me crazy:

HOW the reveal widgets detects when the referenced tiddler have been created with your form and when it is an already existing non-related tiddler.


Stephan Hradek

unread,
Nov 14, 2014, 6:30:02 AM11/14/14
to tiddl...@googlegroups.com


Am Freitag, 14. November 2014 11:04:00 UTC+1 schrieb Tobias Beer:
Thanks a lot, Stephan!

I think that's quite a prominent candidate for tw5magick ...if that's what you use it for.

Sure it is - but  Istill have to catch up with the current version. :(

Stephan Hradek

unread,
Nov 14, 2014, 6:33:49 AM11/14/14
to tiddl...@googlegroups.com

It's very simple in this case. When the tiddler's title is equal to it's text ("Skeeve" == "Skeeve") it's one of mine. Otherwise it's unrelated.

This is not a perfect solution but here it worked. One could as well use the existance of one of the fields as an indicator.


Daniel

unread,
Nov 29, 2014, 9:26:37 AM11/29/14
to tiddl...@googlegroups.com
Hi Stephan!

I like this example of a form. A question about the fetch button: Could I fetch a tiddler by another field, rather than the title field? I am thinking if I had a unique id-field, could I fetch the tiddler by it? I know the unique id, but I don't know the title of the tiddler in this scenario. Hope you or anyone can help and also understand the question.

Daniel

Stephan Hradek

unread,
Nov 29, 2014, 3:13:36 PM11/29/14
to tiddl...@googlegroups.com
Maybe… You would have to have a <$list> with a filter for this unique ID.

Tobias Beer

unread,
Dec 20, 2014, 8:58:29 AM12/20/14
to tiddl...@googlegroups.com
Hi Stephan,

does this "fetch" button still work for you in 5.1.7?
If it does, what am I missing?
I thought it might load the current values from an existing tiddler into the form.

Best wishes, Tobias.

Birthe C

unread,
Dec 20, 2014, 10:15:13 AM12/20/14
to tiddl...@googlegroups.com
Hi Tobias,

It works for me after the upgrade.
Entering an existing Username and pressing fetch, loads the values.


Birthe

Tobias Beer

unread,
Dec 20, 2014, 12:54:40 PM12/20/14
to tiddl...@googlegroups.com
hi Birthe,
 
It works for me after the upgrade.

Are you sure?!?

When I set some arbitrary tags and then hit refresh... the form stays just as it is in Firefox and Chrome.

Best wishes, Tobias.

Birthe C

unread,
Dec 20, 2014, 3:42:46 PM12/20/14
to tiddl...@googlegroups.com
Hi Tobias

I am sure. My expanded and Danish version works, I am glad to say, All that private data ;-)

I had a look at your example http://tb5.tiddlyspot.com/#New%20Tiddler%20From%20Form, tried to fill in a name etc. But you seem not to have the clear button. I have to clear the form, to be able to fetch another example.


Birthe

Birthe C

unread,
Dec 20, 2014, 4:25:37 PM12/20/14
to tiddl...@googlegroups.com
Hi Tobias,

Your example did not work for me either. I uploaded a minimal test for you to try here: http://testdb.tiddlyspot.com/


Birthe



Sylvain Naudin

unread,
Dec 20, 2014, 4:42:49 PM12/20/14
to tiddl...@googlegroups.com
Hi Tobias,

like Birthe, after upgrade everything works for me with my tiddler form.

Sylvain

Tobias Beer

unread,
Dec 21, 2014, 5:15:02 AM12/21/14
to tiddl...@googlegroups.com
Hi Birthe,
 
Your example did not work for me either

There was a supefluous linebreak in some attribute. ;-)
It's working now.

Best wishes, Tobias.

Michael Wiktowy

unread,
Dec 22, 2014, 3:00:45 PM12/22/14
to tiddl...@googlegroups.com
Thanks for this bit of TiddlyMagic, Stephan. I adapted it to a little tool to make it easy to make a bunch of external links of the _canonical_uri type in one of my documents. The resulting code that is going into my generic toolbox was:

\define theTiddler() $(the_tiddler)$!!title

\define myconcat() $(t1)$$(t2)$

|!Filename |<$edit-text tiddler="$:/temp/ExternalLink" placeholder="filename" tag="input" type="text"/> |
|!Directory |<$edit-text tiddler="$:/temp/ExternalLink" field="directory" placeholder="directory" tag="input" type="text"/> |

''Filetype:'' <$select tiddler='$:/temp/ExternalLink' field='type' default='image/gif'>
<$list filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]each[group]sort[group]]'>
<optgroup label={{!!group}}>
<$list filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]group{!!group}] +[sort[description]]'>
<option value={{!!name}}><$view field='description'><$view field='title'/></$view> (<$view field='name'/>)</option>
</$list>
</optgroup>
</$list>
</$select>

<$set name="t1" value={{$:/temp/ExternalLink!!directory}}>
<$set name="t2" value={{$:/temp/ExternalLink!!text}}>

_canonical_uri field = <<myconcat>>

<$reveal type="nomatch" text="" state="$:/temp/ExternalLink">
  <$reveal type="match" text={{$:/temp/ExternalLink}} state={{$:/temp/ExternalLink}}>
    <$button set="$:/temp/ExternalLink!!title" setTo={{$:/temp/ExternalLink}}>
<$action-setfield $tiddler="$:/temp/ExternalLink" $field="_canonical_uri" $value=<<myconcat>>/>
      Modify
    </$button>
    <$set name="the_tiddler" value={{$:/temp/ExternalLink}}>
    <$button setTo="$:/temp/ExternalLink" set=<<theTiddler>>>
      Fetch
    </$button>
    </$set>
  </$reveal>
  <$reveal type="match" text="" state={{$:/temp/ExternalLink}}>
    <$button set="$:/temp/ExternalLink!!title" setTo={{$:/temp/ExternalLink}}>
<$action-setfield $tiddler="$:/temp/ExternalLink" $field="_canonical_uri" $value=<<myconcat>>/>
      Create
    </$button>
  </$reveal>
</$reveal>
</$set>
</$set> 

I am thinking of modifying this into a global macro that just takes in a url so that you can type something along the lines of:

<<a url>>

that will embed a mime-type dropdown and a button that will make an external resource tiddler named "url" if one doesn't exist or just transclude it if it does. Making sure each instance in a Tiddler/TiddlyWiki is separate might take some thinking about though.

/Mike

Stephan Hradek

unread,
Nov 12, 2014, 3:05:51 PM11/12/14
to tiddl...@googlegroups.com
The previous version could overwrite tiddlers which were not created with the form.

If you stick to tiddler!!title == tiddler!!text, mwaning: You won't overwrite the content of the tiddlers created with the form, this version will prevent you from overwriting tiddlers not created with the form, by simply not offering the Create button when a tiddler already exists

\define theTiddler() $(the_tiddler)$!!title

|!Username |<$edit-text tiddler="$:/temp/newuser" placeholder="username" tag="input" type="text"/> |
|!First Name |<$edit-text tiddler="$:/temp/newuser" field="firstname" placeholder="first name" tag="input" type="text"/> |
|!Last Name |<$edit-text tiddler="$:/temp/newuser" field="lastname" placeholder="last name" tag="input" type="text"/> |
|!E-Mail |<$edit-text tiddler="$:/temp/newuser" field="email" placeholder="e-mail address" tag="input" type="text"/> |
|!sometags |<$checkbox tiddler="$:/temp/newuser" tag="Admin"> Admin</$checkbox><br/><$checkbox tiddler="$:/temp/newuser" tag="cron"> cron</$checkbox><br/><$checkbox tiddler="$:/temp/newuser" tag="www"> www</$checkbox> |

<$reveal type="nomatch" text="" state="$:/
temp/newuser">
  <$reveal type="
match" text={{$:/temp/newuser}} state={{$:/temp/newuser}}>
    <$button set="
$:/temp/newuser!!title" setTo={{$:/temp/newuser}}>
      Modify
    </$button>
    <$set name="
the_tiddler" value={{$:/temp/newuser}}>
    <$button setTo="
$:/temp/newuser" set=<<theTiddler>>>
      Fetch
    </$button>
    </$set>
  </$reveal>
  <$reveal type="
match" text="" state={{$:/temp/newuser}}>
    <$button set="
$:/temp/newuser!!title" setTo={{$:/temp/newuser}}>
      Create
    </$button>
  </$reveal>
</$reveal>

Just try it on tiddlywiki.com, entering "HelloThere" as Username. Note that a Create Button will appear after the first character and vanish when the name is complete.
Reply all
Reply to author
Forward
0 new messages