Use of external image in macro

56 views
Skip to first unread message

Guido B

unread,
Jun 7, 2020, 2:25:31 AM6/7/20
to TiddlyWiki
Hi

I started using TW a couple of weeks ago and I love it. However, I still struggle with the syntax. Here's my problem: 
  • I make external images available through _canonical_uri. 
  • I would like to use these images not only by transcluding them, but also by referring to them in a macro. 
  • Example of such a macro: <<image-pretty img:"files/images/2020-06-05 DS MindMap.png" width: "600px">>
  • The path of the image is the same as the one used when filling in the _canonical_uri
  • I know that I can get the text of the _canonical_uri field by using {{titel of image tiddler!!_canonical_uri}}
  • What I don't know is how to use this information in the above macro. What is the syntax to use the text information from {{titel of image tiddler!!_canonical_uri}} in macros requiring text input?
Thanks in advance for any hint. 

Guido

Silverfox

unread,
Jun 7, 2020, 4:40:57 AM6/7/20
to TiddlyWiki
In this case it' better to use the Macrocall widget

if your Macro is like
\define myMacro(myPath)
xxx
\end

Then you call it this way :

<$macrocall $name="myMacro" myPath= {{titel of image tiddler!!_canonical_uri}}/>

Nicolas

Guido B

unread,
Jun 7, 2020, 4:54:45 AM6/7/20
to TiddlyWiki
Perfect, that did the trick! Many thanks. 
Reply all
Reply to author
Forward
0 new messages