Compose a link from text and transcluded field value

In a simple template I try to insert a wikipedia link to the title of the tiddler.
I thought about something like this

https://fr.wikipedia.org/wiki/{{!!title}} But this is not working. I guess I need to compose the link with the help of prefix and suffix. But I don’t know how to put it in order…

If someone could give me a hint, I would be happy.

Thank you

I just tried this

{{{ [{!!title}addprefix[https://fr.wikipedia.org/wiki/]] }}} but it results in a tiddler link and not an internet link…still searching.

I recommend storing links in the text or a field not in the title for a whole lot of reason I have stated in the past about using compound titles.

  • Renaming titles is a multistep process

This is not stored in a title. I just try to set a template tiddler with an automatic wikipedia link to the title of the tiddler based on this template.

The tiddler ‘tiddlywiki’ would have a working link to https://fr.wikipedia.org/wiki/tiddlywiki.

HI give this a go

\define makelink(lnk) https://fr.wikipedia.org/wiki/$lnk$ 
<$macrocall $name=makelink lnk={{!!title}}/>
1 Like

It works like a charm, thank you buggyj.

1 Like

I like @buggyj’s macro better, but you could do it inline like this:

<a href={{{ [{!!title}addprefix[https://fr.wikipedia.org/wiki/]] }}}>{{!!title}}</a>

And this could probably be simplified.

1 Like