vpl
October 1, 2024, 9:30am
1
Hi,
I need the community help as I try to format a link to an external (pdf) ressource using tiddler fields. But I cannot achieve it …
When I run the following list of song with a hard coded link to the external resource, it works
<$list filter="[!is[system]tag[song]sort[song_title]]">
* [ext[As a download pdf (android) |files/test.pdf]]
</$list>
Now when I try to customize the resource link using the tiddler ‘book_fime_name’ fields like that, It does not work …
<$list filter="[!is[system]tag[song]sort[song_title]]">
* [ext[As a download pdf (android) |files/{{{ [<currentTiddler>get[book_file_name]] }}}]]
</$list>
Ir returns
* As a download pdf (android) }}}]]
* As a download pdf (android) }}}]]
* As a download pdf (android) }}}]]
which is obviously not what I’m looking for …
Any expert in the community to help me ?
I will appreciate
Regards
Since wikitext syntax isn’t parsed in (See Linking in WikiText ), you need to use WikifyWidget and Substituted Attribute Values .
<$list filter="[!is[system]tag[song]sort[song_title]]">
<$wikify name="song" text=`[ext[As a download pdf (android) |files/${ [<currentTiddler>get[book_file_name]] }$]]` output="html" mode="inline">
* <<song>>
</$wikify>
</$list>
Here’s another method that doesn’t use $wikify:
\define extpdf() [ext[$(song)$|files/$(filename)$]]
<$list filter="[!is[system]tag[song]sort[song_title]]" variable=song>
* <$let filename={{{ [<song>get[book_file_name]] }}}><<extpdf>></$let>
</$list>
The extpdf() macro constructs the external link output by using macro “variable substitution” to insert the current song tiddler title and book_file_name fields into the wikitext syntax.
-e
vpl
October 2, 2024, 7:46am
4
Hi Eric & XLBilly
I really appreciate your rapid answer. Both approach are working. I really thank you for your quick & efficient support.
Have a nice day
I Love tiddlywiki !!