[TW5] Concatenate 3 tiddler fields into 1 URL

158 views
Skip to first unread message

reakt...@gmail.com

unread,
Dec 8, 2016, 3:21:14 PM12/8/16
to TiddlyWiki
I have a table of tiddlers tagged "HD Ticket" and a tiddler titled, "HD Ticket Settings" which holds 2 fields, "url_header" and "url_footer". I'm trying to concatenate these fields to make this a clickable URL however, I havent been very successful and haven't had much luck interpreting some of the other hints for concatenation.

Generally, what I need to see should be something like <a href="url_header"+"title"+"url_footer"> For example:

title = Ticket123456
url_footer = /view/ticketinfo


I found a few discussions about concatenation but none of them were working.




Mark S.

unread,
Dec 8, 2016, 4:20:52 PM12/8/16
to TiddlyWiki
You don't explain where the title field is supposed to come from, but I'm guessing it's from a tiddler with the ticket as a name. If so, this should give you a link:

\define ticket(title,header,footer) <a href="$header$$title$$footer$" target="_blank">Link</a>

<$macrocall $name="ticket" title=<<currentTiddler>> header={{HD Ticket Settings!!url_header}} footer={{HD Ticket Settings!!url_footer}}/
>

In practice, you would want to put that macro definition in a tiddler identified as a global macro, so that you could reuse it.

HTH
Mark

Mark S.

unread,
Dec 8, 2016, 4:21:48 PM12/8/16
to TiddlyWiki
I forgot to mention, I'm assuming a current tiddler of name Ticket123456.

Jed Carty

unread,
Dec 8, 2016, 4:32:59 PM12/8/16
to TiddlyWiki
I wrote up some stuff about what works and what doesn't work with this here: http://inmysocks.tiddlyspot.com/#Concatenating%20text%20to%20make%20dynamic%20URLs
Reply all
Reply to author
Forward
0 new messages