Hi Merry,
This isn't valid XML/HTML/wikitext:
<$link to=<$view field=birthcountry/></$link>
You can never nest widgets within attributes of other widgets like this
(side note: notice that even if this was allowable, you would be missing a
closing > after the /> to finish the opening $link tag). More generally, it
might be worth learning now that in an attribute like to=, you can do
exactly one of four things in TW:
- to="constant value" [see note 1]
- to={{field transclusion}}
- to={{{filtered transclusion}}}
- to=<<variable transclusion>>
Any combination of these, or any other content, won't work. Here's a summary
of the available transclusion syntax
<https://groktiddlywiki.com/read/#Summary%20of%20Macro%20and%20Transclusion%20Syntax>
.
Fortunately, there's no need to use a $view widget here – you can just
transclude the field with the double-brace syntax:
<$link to={{!!birthcountry}}/>
[1] There are three other ways you can quote the value: """triple
quotes""", 'single quotes', and sometimes no quotes at all (if there aren't
any spaces or special characters in the value).
On Saturday, June 26, 2021 at 6:10:43 PM UTC-5 [email protected] wrote:
> Hello, I think this is a pretty basic problem, but I've not been able to
> figure out how to do it.
>
> Within tiddlywiki, I have profiles for made-up individuals. I have
> birthcountry of each individual recorded as a field. I also have
> wikipedia-style sideboxes with individuals date of birth, date of death,
> parentage, children....etc and birthcountry as well.
>
> All I want to do is have it so that I can use the birthcountry field to
> supply a value that I can use as both text and a link to another tiddler.
>
> For example:
> John Smith
> Born - 04/05/1872 - Fantasyshire, MadeupLand (with "MadeupLand" value
> drawn from the field and also used link to a tiddler with the title
> "MadeupLand")
>
> Currently, I can retrieve the field value:
>
> <$view field=birthcountry/>
>
> And I can manually link to 'MadeupLand':
>
> <$link to="MadeupLand"></$link>
>
> But putting them together like this:
>
> <$link to=<$view field=birthcountry/></$link>
>
> Does not work, I just get "true</$link>"
>
> Any help would be much appreciated!
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/9d2b6680-e9e2-4307-87e6-875e7fd1dd69n%40googlegroups.com.