> Try adding this as a plugin - usage is then <<image {{url}} {{width}}
> {{height}}>>
> eg.<<image foo.jpg 150 150>>
...
> var html = "<html><img src='" + params[0] + "'";
> if(params[1]){
>  html += "width='" + params[1] + "' ";}
> if(params[2]){
>  html += "height='" + params[2] + "' ";}
> html += "></html>";
> wikify(html,place);

To 'substitute and wikify' some content, you don't need to create a
plugin or custom macro... instead, try this:

First, define a tiddler, [[ScaledImage]], containing:
   <html><img src="$1" style="width:$2;height:$3"></html>
then, to use it, write:
   <<tiddler ScaledImage with: foo.jpg 150px 150px>>
The parameters following "with:" are automatically inserted in place
of $1, $2, $3, etc... (up to $9) when the content from [[ScaledImage]]
is rendered.

You could even generalize this a bit further by writing
[[StyledImage]]:
   <html><img src="$1" style="$2"></html>
which could be used to produce the same results as above by writing:
   <<tiddler StyledImage with: foo.jpg "width:150px;height:150px">>
but could also be used to apply other CSS styles to that image, like
this:
   <<tiddler StyledImage with: foo.jpg "margin:1em;border:10px outset"

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to