Create an external link for a pdf where the filename is stored in a tiddler field.

80 views
Skip to first unread message

si

unread,
Oct 29, 2019, 3:21:39 PM10/29/19
to TiddlyWiki
I have tiddlers for books with the title of the book stored in a field called "book-title", and I want to create a link to the pdf of the book.

For example say I have a tiddler containing the field "book-title=[[Oliver Twist]]".

I want to create a template to generate a link of the form "[ext[Oliver Twist|.\books\Oliver Twist.pdf]]".

I have tried "[ext[{{!!book-title}}|.\books\{{!!book-title}}.pdf]]" but this doesn't work.

If anyone can help me out I would really appreciate it.

Thanks in advance.

Eric Shulman

unread,
Oct 29, 2019, 4:10:04 PM10/29/19
to TiddlyWiki
On Tuesday, October 29, 2019 at 12:21:39 PM UTC-7, si wrote:
I have tiddlers for books with the title of the book stored in a field called "book-title", and I want to create a link to the pdf of the book.
For example say I have a tiddler containing the field "book-title=[[Oliver Twist]]".
I want to create a template to generate a link of the form "[ext[Oliver Twist|.\books\Oliver Twist.pdf]]".
I have tried "[ext[{{!!book-title}}|.\books\{{!!book-title}}.pdf]]" but this doesn't work.

In order to construct wikitext syntax that inserts a value from a field, you first need to create a macro definition, like this:
\define book-link(title) [ext[$(title)$|.\books\$(title)$.pdf]]

Then, to use it, you would write:
<$vars title={{!!book-title}}><<book-link>></$vars>

Let me know how it goes...

enjoy,
-e
Eric Shulman
TiddlyTools: "Small Tools for Big Ideas" (tm)   http://tiddlytools.github.io/
InsideTiddlyWiki: The Missing Manuals    http://insidetiddlywiki.tiddlyspot.com/

si

unread,
Oct 29, 2019, 4:45:22 PM10/29/19
to TiddlyWiki
Thank you so much, works perfectly!
Reply all
Reply to author
Forward
0 new messages