Hi Shay, Learning by doing, the best way ;-)
Instead of using the @@ syntax, you could add a class="TW-mage" to the <img ... >. And if you need different styles for your images, you can add a style to your macro as well: \define image (source,caption,style) ... <img ...class=$style$ ...> \end Cheers, Ton On Friday, October 28, 2016 at 1:35:07 PM UTC+2, Shay Shaked wrote: > > Ah HA! Answered my own question. > > Went to the official TW pages. Like always, if you just look at them > without having some previous hints provided to build on (like I got here in > this awesome group) I wouldn't know what to do. But, looking at the syntax, > I tried this: > > \define image(source caption) > @@.TW-image > <a href="TW_Media/$source$" title="tooltip" target="_blank"> > <img src="TW_Media/$source$" width="" height="250"/></a><br>^^$caption$^^ > @@ > \end > > And walla! an image AND a caption defined within a single line, without > the need of adding a 10px margin physically via photoshop (which is how > I've done it so far). > > I really hope this will be useful for anyone else needing help! it worksss! > > > > On Friday, October 28, 2016 at 7:27:37 AM UTC-4, Shay Shaked wrote: >> >> This is amazing stuff! >> >> I worked on the macro to reflect the style I want: >> \define image(source) >> @@.TW-image >> <a href="TW_Media/$source$" title="tooltip" target="_blank"> >> <img src="TW_Media/$source$" width="" height="250"/></a> >> @@ >> \end >> >> >> >> where .TW-image is as follows: >> >> .TW-image{ >> float: right; >> margin-left: 10px; >> width: 250px; >> >> } >> >> >> And it all works fine in the macro. >> >> Here's the last thing I want: the ability to add a caption below. >> In the past, I wrote the whole thing down like so: >> >> @@float: right; >> <a href="TW_Media/image.png" target="_blank"> >> <img src="TW_Media/image.png" width=400 ></a><br>^^this is the caption^^ >> @@ >> >> And I had the ability to add the caption as you can see. But now if I >> throw it into the macro, it will give me the same caption each time. What >> I'm looking for is something kinda like this: >> >> \define image(source)(caption) >> >> I know the syntex is wrong. How do I tell the macro I need to put in two >> "variables" (not sure that's the right term)? >> >> >> >> >> >> On Friday, October 28, 2016 at 2:43:55 AM UTC-4, Tobias Beer wrote: >>> >>> Hi Ton, >>> >>> >>>> It is very simple: >>>> >>>> Create a tiddler, e.g. $:/_image-thumbnail-macro, tagged with >>>> $:/tags/Macro, which contains: >>>> >>> >>> ...it's kind of interesting, these entry-level barriers that kinda force >>> every newcomer to take a moment and ponder the workings of TiddlyWiki, so >>> as to learn to make good use of it rather than just rely on pre-baked >>> components and solutions. >>> >>> Best wishes, >>> >>> Tobias. >>> >> -- 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+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@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/b5327e23-b191-40ac-9a69-294bb6ac1e78%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.