how to show the list macro result with icon ?

124 views
Skip to first unread message

imleg...@gmail.com

unread,
Sep 24, 2020, 5:11:08 AM9/24/20
to TiddlyWiki
Here is the filter I use

<$list filter="[prefix[Excel]tag[kp]]">
   <h2><$link /></h2>
</$list>

Some of the tiddlers selected with icon field set.  So the tiddler itself with a icon 
ahead.  Like the image shown. I want the icon shown in the list result how to make it? 无标题.png

PMario

unread,
Sep 24, 2020, 5:41:03 AM9/24/20
to TiddlyWiki
Hi

Try

<$list filter="[prefix[Excel]tag[kp]]">
   <h2><$transclude tiddler={{!!icon}}/> <$link /></h2>
</$list>

You'll need to adjust some CSS settings, but it should do what you want.

-mario

Eric Shulman

unread,
Sep 24, 2020, 5:41:26 AM9/24/20
to tiddl...@googlegroups.com
The icon field should contain the name of an image tiddler.  To show this image, use the $transclude widget, like this:
<$list filter="[prefix[Excel]tag[kp]]">
   <h2><$transclude tiddler={{!!icon}}/><$link /></h2>
</$list>

Note: if you want the image to be included in the link, then write it this way:
<$list filter="[prefix[Excel]tag[kp]]">
   <h2><$link><$transclude tiddler={{!!icon}}/><$text text={{!!title}}/></$link></h2>
</$list>


enjoy,
-e
Message has been deleted

imleg...@gmail.com

unread,
Sep 24, 2020, 9:55:43 PM9/24/20
to TiddlyWiki
How to set the size of the image ahead, some of them is large



And by the way where can I found the manual about "!!title" or "!!icon" things? 

imleg...@gmail.com

unread,
Sep 24, 2020, 9:56:26 PM9/24/20
to TiddlyWiki
无标题.png

Eric Shulman

unread,
Sep 24, 2020, 10:32:29 PM9/24/20
to TiddlyWiki
On Thursday, September 24, 2020 at 6:55:43 PM UTC-7, imleg...@gmail.com wrote:
How to set the size of the image ahead, some of them is large

Assuming you are using this code to produce your list:
<$list filter="[prefix[Excel]tag[kp]]">
   
<h2><$link><$transclude tiddler={{!!icon}}/><$text text={{!!title}}/></$link></h2>
</$list>

Then, create a stylesheet tiddler (e.g., "MyStyles"), tagged with $:/tags/Stylesheet, containing:
h2 img, h2 svg { height:1em; width:1em; }
This will force all images (including SVG images) that are contained within an "h2" heading to be automatically resized to the same height as the text.
 
And by the way where can I found the manual about "!!title" or "!!icon" things? 

Start with this tiddler:
then follow the links at the bottom of that tiddler for more info.

enjoy,
-e

imleg...@gmail.com

unread,
Sep 26, 2020, 8:23:39 PM9/26/20
to TiddlyWiki
Thank you man, really helps a lot. : )
Reply all
Reply to author
Forward
0 new messages