link images to tiddlers using listwidget by fetching image path from tiddlers field

104 views
Skip to first unread message

Rene

unread,
Jan 13, 2017, 5:37:56 PM1/13/17
to TiddlyWiki
I have got a bunch of book tiddlers tagged with "book" and an image-path within a field called img-path (img-path: path/to/image/book-cover.jpg e.g.)
I would like to create a list displaying the book covers linking to the specific book tiddlers.
How can i do this?

Is it possible to use ListWidget some sort like this?

<$list filter="[tag[book]]">
...???...
</$list>





Mark S.

unread,
Jan 13, 2017, 9:08:33 PM1/13/17
to TiddlyWiki
There are different ways of doing this, but basically you need a macro to concatenate the field field with the image framing. Something like:

\define showimage(img) [img[$img$]]


<$list filter="[tag[books]]" >
<<currentTiddler>> <$macrocall $name="showimage" img={{!!imgpath}}>>
</$list>

Rene

unread,
Jan 14, 2017, 6:40:46 PM1/14/17
to TiddlyWiki
Thanks for the solution Mark! Yes, it works well.

After some experimenting i did it this way (without macro) which also works nicely.

<$list filter="[tag[book]]">
<$link><$image source={{!!img-path}} /></$link>
</$list>

sini-Kit

unread,
Jan 16, 2017, 4:16:05 AM1/16/17
to TiddlyWiki
it is better to use source={{!!_canonical_uri}} here is example https://design4shop.ru/heeg.html#lamobile

воскресенье, 15 января 2017 г., 2:40:46 UTC+3 пользователь Rene написал:
Reply all
Reply to author
Forward
0 new messages