Hi guys,

I'm a little new to tiddlywiki, and find some functionalities don't work as
I thought, including macro call and transclusion.

The background is that I have a DataTiddler, which stores the baseurl of
the site (when published); let's call this `dt##baseurl`. I have a feed
plugin installed to generate atom feed, under `/atom.xml`, relative to the
baseurl. (Some may suspect I intend to make this site like a blog, and you
are right.)

When I need to concatenate these two pieces of text together, as mentioned
elsewhere (e.g. official site), I need to use a helper macro to establish
the real concatenation of transclusion and string literal. (But I still
don't know why... Is this because of the processing engine's execution
order / lifecycle?)
I succeeded to do this when using text as the visible content, through
`[[$text$|$baseurl$/atom.xml]]`.

However, when I want to create a image which links to the atom feed, I find
no solution.
I have to use `<a href=... >[img[MY_IMG]]</a>` for this to work (LinkWidget
will link to tiddler only; `[[]]` syntax only works on text). But if I
apply the previous trick, neither of the follow methods work.

Method 1:

```
  \define atomfeed(burl) $burl$/atom.xml
  <a href=<$macrocall $name=atomfeed burl={{dt##baseurl}}
/>>[img[MY_IMG]]</a>
```

The $macrocall widget won't really work, and the resulting line is broken.
I guess this is because of the `/>`.

Method 2:

```
  \define atomfeed(burl) $burl$/atom.xml
  <a href=<<atomfeed {{dt##baseurl}}>>>[img[MY_IMG]]</a>
```

The macro will be evaluated, but the transclusion won't, resulting in a
link to "{{dt##baseurl}}/atom.xml".

Method 3:

```
  \define atomfeed(burl) $burl$/atom.xml
  \define wrapatomfeed() <$macrocall $name=atomfeed burl={{dt##baseurl}} />
  <a href=<<wrapatomfeed>>>[img[MY_IMG]]</a>
```

The macro will be evaluated once, but the second macrocall won't be
evaluated at all.


I also tried a few other combinations of these methods (e.g. replace the
3rd method's wrap macro content to `<< >>`), but none of them worked.
Anyone has any ideas?

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/CAHiJFWS5gKe4Aag1yiStKpr7%3D2F4nVhV_EzefFypnzyOYeHDNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to