transcluding images and controling their size - quick and dirty

94 views
Skip to first unread message

Pit.W.

unread,
Apr 16, 2017, 9:04:08 AM4/16/17
to tiddl...@googlegroups.com

I allow myself to publish my latest little insight below, since it is a topic which bothered me for quite some time.
Maybe it will either help somebody, or it will turnout that others have found a much better solution.

  1. The intention: I have a collcetion of images (png) which I want to use as tiddlericons (in the icon field). In order to do so, I want to have a $select - tool, which displays the icons as images.
  2. My problem: The images are rather big (512 and bigger), but I want them displayed in the same size as the text
  3. #Jermolene says here: "You can also display an image stored in a tiddler by transcluding that tiddler. The disadvantage of this approach is that there is no direct way to control the size of the image."
  4. The solution, not so quick, but dirty: I include in the text of the select-option  a table with just 1 row and 1 field. In the field I have the tranclusion of the image. I set the style of the field to a width of 1em: and get a small image  -  see below
  5. Caveat: It seems, this works only in a standalone-TW, not under node.js or online; size must be >1.3em

Kind regards,

Pit.W



<$select field="icon">
<$list filter="[tag[$:/MyIcon]sort[title]]">
            <option value=<<currentTiddler>>>
                <table>
                    <tr>
                        <td style="width:3em;">
                                <$transclude/>
                        </td>
                    </tr>
                    </table>
        </option>
</$list>
</$select>
 



Xavier Cazin

unread,
Apr 16, 2017, 9:22:46 AM4/16/17
to tiddl...@googlegroups.com
Hi Pit. W

Nice trick, thank you for sharing; and I can testify that it works very well in NodeJS mode too!

Cheers,
X.

-- Xavier Cazin

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/8e24cebe-ebaf-1629-34b4-4b24b567a32d%40eclipso.ch.
For more options, visit https://groups.google.com/d/optout.

Pit.W.

unread,
Apr 16, 2017, 9:27:59 AM4/16/17
to tiddl...@googlegroups.com

Xavier,


thanks for this additional info. My node,js includes so many plugins, that maybe sometimes strange effects occur.


Pit

-- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com. To post to this group, send email to tiddl...@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CADeSwYMcpiMWUiDwbwEXwDu2BLXg1wL7gqYMj7rKt1a-6y%2BJ_g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.



Reply all
Reply to author
Forward
Message has been deleted
0 new messages