Forum


Replies: 4   Views: 6924
Replace template variable with text containing new line
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by medscope  · 29-11-2012 - 02:17

[b]I have these text in the template[/b]

Thank you for referring $Name$ for a Home Medication Review. $P_GName$ was interviewed on $Date_of_Review$.$extraText$All medications were reviewed in light of the information you provided in the referral and that obtained during the interview.

[b]where $extraText$ could be empty or text with multiple lines.[/b]

[b]if it's empty the output will be[/b]
Thank you for referring $Name$ for a Home Medication Review. $P_GName$ was interviewed on $Date_of_Review$. All medications were reviewed in light of the information you provided in the referral and that obtained during the interview.

[b]if it's not empty, the output will be[/b]
Thank you for referring $Name$ for a Home Medication Review. $P_GName$ was interviewed on $Date_of_Review$.
/*this is new line*/
Warning, it's extra text for following reasons:
- Reason 1
/*this is new line*/
All medications were reviewed in light of the information you provided in the referral and that obtained during the interview.

[b]but the addTemplateVarible can't recognise \n and the replaceTemplateVariableByHTML can't recognise <br> at the start and the end of $extraText$ the output will become[/b]
Thank you for referring $Name$ for a Home Medication Review. $P_GName$ was interviewed on $Date_of_Review$. Warning, it's extra text for following reasons:
- Reason 1 All medications were reviewed in light of the information you provided in the referral and that obtained during the interview.

[b]so How can I replace that template variable with text into a seperated paragraph[/b]