Hi Jeremy,
As a more generic approach...
>
> \define img(url,path)
> <img src="<<if "$path$" "$path$" "http:/default:url/">>$url$">
> \end
>
> In other words, will it be possible to define something like the above
> where the first expression checks whether the *string* being *$path$* is
> empty or not and if it isn't use it otherwise use some default url perhaps
> even defined in some global configuration, e.g. *$:/settings/**user/**
> paths.img* ...fetched via {{$:/settings/user/paths##img}} ?!?
>
Ok, so the if stuff perhaps wasn't good enough. How about something like...
\define img(url,pathIdentifier)
<img
src="*<<get* '{{$:/settings/user/paths##$pathIdentifier$}}'
'{{$:/settings/user/paths##img}}'*>>*"
$url$">
\end
Whereas that above *get* macro or some syntactical equivalent would try to
fetch some content and use that when defined, otherwise use the second
parameter as the default (or empty string).
And then I could use...
<<img foo.jpg bar>>
which would construct the image path using the path defined in
$:/settings/user/paths##bar or just
<<img foo.jpg>>
which would take the default image path defined in
$:/settings/user/paths##img and append foo.jpg to it.
- tobias.
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.