External Link from Field for Google Maps Search

60 views
Skip to first unread message

Appeal System

unread,
Oct 24, 2017, 10:20:10 AM10/24/17
to TiddlyWiki
Hello,

I am attempting to create a contacts database that automatically creates a "google maps search" to an address. (This is so that when on my mobile device, I can look up a name and simply click an address to get directions to that persons house.

To do this I use the following example:


I have 2 fields within my Tiddlers contact form:

Field 1: Google Maps Link: 


Field 2: address (in my contacts db):

the white house

I think what I am trying to do has already been solved here, but I don't understand it fully.

In my simple TW5 knowledge I am trying to accomplish this:

[ext[{{!!googlemapslink}}+{{!!address}}]]

but I know this doesn't work due to how the transclusion works. I have also tried to \define my field as a variable and insert it like this:

Where field: {{!!addgmap}} = {{!!googlemapslink}}{{!!address}}
\define mymacro()
<$set name="result" value={{!!addgmap}}>
<<result>>
</$set>
\end

<a href=<<mymacro>>>Test </a>

<<mymacro>>


And it successfully creates a link, but the link points something like this: 
MYSERVERIP/<$set%20name="result"%20value=%7B%7B!!addgmap%7D%7D><<result>></$set>

I am quite new to this language, and generally just manipulate others code to work for my purposes, but this is the first time I've attempted to build something myself and I am failing lol.

Thanks in advance for your help,

Anthony


Mark S.

unread,
Oct 24, 2017, 10:41:25 AM10/24/17
to TiddlyWiki
Ok this worked for me:

\define mymacro() [ext[$(ggml)$$(add)$]]

<$vars ggml={{!!googlesmapslink}} add={{!!address}}>

<<mymacro>>
</$vars>

In general, you need to set your fields into variables using a widget (e.g. the vars widget) wrapped outside of the macro you want to invoke. Inside the macro you can use the special macro environmental variables $(var)$ to "glue"
your text together. That's just my interpretation -- I've never been able to complete synthesize how everything is supposed to work. But I find this pattern is pretty reliable.

Good luck,
Mark

Appeal System

unread,
Oct 24, 2017, 11:38:12 AM10/24/17
to TiddlyWiki
That worked perfectly, thanks Mark!
Reply all
Reply to author
Forward
0 new messages