On Friday, November 14, 2014 6:33:49 AM UTC-5, Stephan Hradek wrote:
>
>
>
> Am Freitag, 14. November 2014 11:17:39 UTC+1 schrieb Danielo Rodríguez:
>>
>> @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. 
>>
>
> 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.
>
>
>
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

-- 
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.

Reply via email to