I'm pretty sure this has been discussed previously but I cannot seem to find the answer.
I want to in a sentence structure test to see if there is a note and then either put out a <br> or a <para> but the <br> or <para> does not seem to be resolved and is just text.
This is what I have tried and does not seem to work:
{=TextIf(Exists(%INDI.BIRT[1].NOTE2[1]%),'<para>','<br>')}
* <para> in sentence structure
-
- Famous
- Posts: 111
- Joined: 14 Nov 2015 15:44
- Family Historian: V7
Re: <para> in sentence structure
It might be because of the angle brackets, which FH will see as part of an expression syntax. I'm not absolutely sure of the solution; have a look at the help here: https://www.family-historian.co.uk/help ... rmats.html
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
- tatewise
- Megastar
- Posts: 28438
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: <para> in sentence structure
=TextIf(...) and similar functions only accept text for the 2nd & 3rd parameters.
'<para>' and '<br>' are plain text strings, so are nothing to do with the formatting codes <para> and <br>.
I think you want to insert an unconditional <br> newline and then a conditional <br> newline if there is a Note so the two newlines are equivalent to a paragraph break.
So use <br><<br>{note}>
BTW: Another technique is to always start such Note fields with a blank newline then the {note} code will always include that newline in the displayed sentence.
'<para>' and '<br>' are plain text strings, so are nothing to do with the formatting codes <para> and <br>.
I think you want to insert an unconditional <br> newline and then a conditional <br> newline if there is a Note so the two newlines are equivalent to a paragraph break.
So use <br><<br>{note}>
BTW: Another technique is to always start such Note fields with a blank newline then the {note} code will always include that newline in the displayed sentence.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
-
- Famous
- Posts: 111
- Joined: 14 Nov 2015 15:44
- Family Historian: V7
Re: <para> in sentence structure
Mike,
That is a great suggestion. I needed to modify slightly <<br>{note}><para> to get the spacing I wanted. This does not allow for this spacing if I don't want the note printed out.
Just for my edification is there a way to do a conditional statement like I had originally tried?
That is a great suggestion. I needed to modify slightly <<br>{note}><para> to get the spacing I wanted. This does not allow for this spacing if I don't want the note printed out.
Just for my edification is there a way to do a conditional statement like I had originally tried?
- tatewise
- Megastar
- Posts: 28438
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: <para> in sentence structure
No, not to govern the <br> and <para> codes because (as I said) the =TextIf(...) function requires text parameters and the formatting codes <br> and <para> are NOT text.TMG_refugee wrote: ↑13 Apr 2024 13:03 Just for my edification is there a way to do a conditional statement like I had originally tried?
Your {=TextIf(...)} conditional statement was valid but only for text parameters "<para>" and "<br>" that are not formatting codes.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
-
- Famous
- Posts: 111
- Joined: 14 Nov 2015 15:44
- Family Historian: V7
Re: <para> in sentence structure
Thanks Mike