[tw5] Re: Linking to Field Values

2021-06-27 Thread Merry Machiavelli
@Eric Shulman Great, that works, thanks! Really minor follow-up question. 
What do I have to put before [field:father-id{!!id}] to get it to actually 
show up on the page as text and a link? 

Currently, I can do this: <> (which is 
the inverse, for finding fathers as opposed to finding sons) but that 
produces a list e.g.

   - Robert Smith

I just want it to show

Robert Smith

Because people only have one biological father! I think the <> 
bit is a 'macro'? I've tried:

<[field:id{!!father}]>
<<[field:id{!!father}]>>
<<$link [field:id{!!father}]>>
<$link to=[field:id{!!father}]>[field:id{!!father}]

All with no luck.

Slightly more general question, I've found myself a bit baffled by 
macros/whatever they are. TiddlyWiki as loads of examples of operators, but 
unless you know what you need to put before them, they aren't actually 
usable! For example, I know the subtract operator looks like this: 

[[23]subtract[19]]

But obviously, just putting that in a tiddler doesn't produce the value 
"4", you have to put something before it. I've got no clue what that should 
be, and the code actually used in the wiki: 

<<.operator-example 1 "[[23]subtract[19]]">>
Does not work. 

Sorry to dump loads of questions! I just get the impression that TiddlyWiki 
is incredibly powerful and perfect for my use-case, but there is a lot of 
basic syntax stuff that I just don't get. 
On Sunday, June 27, 2021 at 1:13:52 PM UTC+1 Eric Shulman wrote:

> On Sunday, June 27, 2021 at 4:04:14 AM UTC-7 merry.ma...@gmail.com wrote:
>
>> Now doing this <>
>> Works to retrieve the children of Robert Smith. However, that involves 
>> manually typing in Robert Smith's id. Instead I want something like 
>> this: <>
>> But that doesn't work...
>>
>
> When specifying the parameter value for a filter operator, *the type of 
> brackets indicate the kind of parameter value* you are using:
>
> square brackets are for *literal* values,  e.g. 
> [field:father-id[634750-LiR]]
> angle brackets are for *variable* values, e.g., 
> [field:father-id] 
> curly braces are for *field references*, e.g.,  [field:father-id{!!id}] 
>
> Also note that within filter syntax, use *single* brackets/braces, rather 
> than the *doubled* brackets/braces that are used within regular wiki text 
> syntax;
> i.e., [634750-LiR] instead of [[634750-LiR]],  instead of 
> <>, and {!!id}} instead of {{!!id}}
>
> enjoy,
> -e
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a7683e9a-7bb6-48d4-8d67-054bc776fd6bn%40googlegroups.com.


[tw5] Re: Linking to Field Values

2021-06-27 Thread Eric Shulman
On Sunday, June 27, 2021 at 4:04:14 AM UTC-7 merry.ma...@gmail.com wrote:

> Now doing this <>
> Works to retrieve the children of Robert Smith. However, that involves 
> manually typing in Robert Smith's id. Instead I want something like 
> this: <>
> But that doesn't work...
>

When specifying the parameter value for a filter operator, *the type of 
brackets indicate the kind of parameter value* you are using:

square brackets are for *literal* values,  e.g. 
[field:father-id[634750-LiR]]
angle brackets are for *variable* values, e.g., 
[field:father-id] 
curly braces are for *field references*, e.g.,  [field:father-id{!!id}] 

Also note that within filter syntax, use *single* brackets/braces, rather 
than the *doubled* brackets/braces that are used within regular wiki text 
syntax;
i.e., [634750-LiR] instead of [[634750-LiR]],  instead of 
<>, and {!!id}} instead of {{!!id}}

enjoy,
-e

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/182c6d0b-163e-475d-a373-28d681115a22n%40googlegroups.com.


[tw5] Re: Linking to Field Values

2021-06-27 Thread Merry Machiavelli
Sorry, supplemental question involving using fields¬

Another thing I want to do is use id and father-id / mother-id fields to 
automatically list the children of an individual. Ids are preferable to 
just names/titles, because of the chance of duplicate names.

How it might work is this. Say Robert Smith has two sons, John Smith and 
Peter Smith. That could be represented in fields like this:

(John Smith fields)

id: 365974-LlO
father-id: 634750-LiR

(Peter Smith fields)

id:  571157-OnU
father-id: 634750-LiR

(Robert Smith fields)

id:  634750-LiR
father-id: 612745-GbF

Now doing this <>

Works to retrieve the children of Robert Smith. However, that involves 
manually typing in Robert Smith's id. Instead I want something like 
this: <>

But that doesn't work...


On Sunday, June 27, 2021 at 10:07:48 AM UTC+1 Merry Machiavelli wrote:

> Thank you so much @Soren Bjornstad, that works perfectly! I think I tried 
> something close to that at one point, I just messed up the syntax!
>
> @iamdar my use case is that I want to be able to mass-produce 
> wikipedia-style bios for individuals, where the the same basic info comes 
> up in multiple parts of the 'article'/tiddler. 
>
> For example, in the opening line, it might say "John Smith was born in 
> MadeupLand", the side bar might also mention he was born in MadeupLand. If 
> I link both references to MadeupLand through a field i.e. using <$link 
> to={{!!birthcountry}} /> then I only have to specify the country John Smith 
> was born in once, in the field. If I iterate this process 100 times (using 
> the same code for most of the body of the article, just customising it with 
> novel information) it saves a lot of typing.
>
> Another advantage is that it makes it easier to call groups of people who 
> share a particle bit of vital information, without necessary creating a tag 
> for, say, "born in 1872" (which, I could do...it just seemed clunky?). The 
> main example that comes to mind is using surnames as a way to list every 
> individual from a particular patrilineal lineage (assuming it's an unusual 
> surname that unrelated individuals are unlikely to share within my 
> group...I could also have a specific familyID field). 
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/1ae075b9-7506-45f0-8362-d9a9ade08920n%40googlegroups.com.


[tw5] Re: Linking to Field Values

2021-06-27 Thread Merry Machiavelli
Thank you so much @Soren Bjornstad, that works perfectly! I think I tried 
something close to that at one point, I just messed up the syntax!

@iamdar my use case is that I want to be able to mass-produce 
wikipedia-style bios for individuals, where the the same basic info comes 
up in multiple parts of the 'article'/tiddler. 

For example, in the opening line, it might say "John Smith was born in 
MadeupLand", the side bar might also mention he was born in MadeupLand. If 
I link both references to MadeupLand through a field i.e. using <$link 
to={{!!birthcountry}} /> then I only have to specify the country John Smith 
was born in once, in the field. If I iterate this process 100 times (using 
the same code for most of the body of the article, just customising it with 
novel information) it saves a lot of typing.

Another advantage is that it makes it easier to call groups of people who 
share a particle bit of vital information, without necessary creating a tag 
for, say, "born in 1872" (which, I could do...it just seemed clunky?). The 
main example that comes to mind is using surnames as a way to list every 
individual from a particular patrilineal lineage (assuming it's an unusual 
surname that unrelated individuals are unlikely to share within my 
group...I could also have a specific familyID field). 


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0aee69dd-f86c-4e06-b9ed-a18d5e55d74en%40googlegroups.com.


[tw5] Re: Linking to Field Values

2021-06-26 Thread Darth Mole
@merry.ma

I just had a quick question about your process. I was wondering why you 
were using a field in the tiddler instead of [[MadeupLand]] to create a 
link? Or, I suppose for that matter, why not simply put the  like you had? Not trying to be rude, truly just 
being curious about your process. Is there a particular reason or benefit 
you get from using the value of a field?

Thank you!

On Saturday, June 26, 2021 at 7:10:43 PM UTC-4 merry.ma...@gmail.com 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, childrenetc 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">
>
> But putting them together like this: 
>
> <$link to=<$view field=birthcountry/>
>
> Does not work, I just get "true"
>
> 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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8e3a7d64-0fa3-4b0d-b67f-23245cf11f36n%40googlegroups.com.


[tw5] Re: Linking to Field Values

2021-06-26 Thread Soren Bjornstad
Hi Merry,

This isn't valid XML/HTML/wikitext:

<$link to=<$view field=birthcountry/>

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=<>

Any combination of these, or any other content, won't work. Here's a summary 
of the available transclusion syntax 

.

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 merry.ma...@gmail.com 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, childrenetc 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">
>
> But putting them together like this: 
>
> <$link to=<$view field=birthcountry/>
>
> Does not work, I just get "true"
>
> 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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9d2b6680-e9e2-4307-87e6-875e7fd1dd69n%40googlegroups.com.


[tw5] Re: Linking to Field Values

2021-06-26 Thread Eric Shulman
On Saturday, June 26, 2021 at 4:10:43 PM UTC-7 merry.ma...@gmail.com wrote:

> 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.
> Currently, I can retrieve the field value:
> <$view field=birthcountry/>
> And I can manually link to 'MadeupLand':
> <$link to="MadeupLand">
> But putting them together like this: 
> <$link to=<$view field=birthcountry/>
> Does not work, I just get "true"
>

Try this:
<$link to={{!!birthcountry}} /> 

enjoy,
-e

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c6cc292d-e17e-4b3d-b66d-783ba0af4554n%40googlegroups.com.