The basic technique is to use <angle brackets> around the data that might be missing. For example,
<Daughter(s): [Daughter]>
That way, when the [Daughter] variable is empty, nothing inside the angle bracket appears. In particular, the Daughter(s): text does not appear.
There is an additional complication in your use case because you have new line characters between your roles. There is nothing wrong with that. I do it all the time in my sentence templates. But you would probably have to play with it a bit to see where the angle brackets need to go with respect to everything else. Otherwise, you could end up with a lot of blank lines when a lot of your variables are null. For example, you might need something like the following. It looks funny, but something like this is probably what you need. I haven’t tested myself to see where best to put the angle brackets with respect to the new lines.
<
Daughter(s): [Daughter]>
<
Son(s): [Son]>
Another thing you could look at the improve things a bit is Plural Switches. That way you could say Daughter for one daughter and Daughters for more than one daughter instead of having to say Daughter(s) all the time. I think you need something like the following, but again I have not tested.
<
<#Daughter#Daughter:|Daughters: [Daughter]>>
Plural Switches
A plural switch looks at the number of people in a group and writes the appropriate text. It is indicated by a “#”. It is of the form:
<#roles# Single > or
<#roles# Single | Plural > or
<#roles# Single | Plural | None >
For example:
<#Doctors#His doctor was|His doctors were> [Doctor].
They had <#Children#a child|<[Children:count]> children|no children>.
There <#Heir1,Heir2#was one heir|was more than one heir|were no heirs>.
My question is how do you get the son/ daughter part to fill in the names of the kids? I copied it just like you have it and it added the wife BUT NOT the kids-- I did it as a Census family rather than individual…
Family facts can be shared exactly like individual facts. That shouldn’t be the problem. Even so, I think the individual Census fact works better than the family Census fact. Namely, the individual Census fact appears in narrative reports along with the other facts for the individual. But the family Census fact appears in narrative reports along with other family facts such as Marriage and Divorce.
It looks like you need angle brackets and that maybe you haven’t defined the roles for the fact. It’s hard to tell without seeing your definitions in the Fact Type list.
Certainly the sentence is inappropriate for a family-type event because it would read badly in the wife’s narrative, appearing as her own wife. It works only for the male head of household. But that has no bearing on the lack of name substitution for the non-Principal roles. That the variable name is printed suggests that the role is undefined. If it was defined, but unassigned to anyone, then the substitution would be blank.
Edit: Jerry beat me to saying much the same thing - I drafted my reply on the phone, then took my mug of tea down to check on my pc and didn’t see that he had more than covered it.
fyi I created many Census roles – also I basically created them in order of distance
not also user will have same ones as me. Also Most user will not have most of the ones I have – here is screen shot one
I will probably work on plural switches after I get rest working – as I have many “roles” to add. For the most part the plurals only apply to sons/daughters and grandchildren – most everything else will be singular, Mother in-law for example)
Thank you - as usual you gave a simple details answer.
Here is what I came up with for this issue. NOTE: You alter the role to anuthing you like. I just tried to make them as close as possible to what would be displayed in the census.
Census: < [Date:Year],>< [PlaceDetails:Plain].>
<Recorded [Date:Plain].>< [Desc]>< [Place:Short]>.< [Person:HeShe:Caps]>< appeared in the census at the age of [Person:Age:Plain]>.
<Household included:
<Wife - [Wife:Proper];