TinyButStrong - the PHP Template Engine
Categories > TinyButStrong general >

if - then and newline

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: Carey
Date: 2014-03-03
Time: 15:55

if - then and newline

I have two variables, AddressA and AddressB.  I only want to show AddressB, with a newline, if it is not blank.

So far I have:
[AddressA][AddressB;if [val]!='';then '
' + [val]]

(intentional carriage return inside the second set of quotes)

But in the document it just shows "+ [val]" on a newline.

Any ideas how to accomplish what I'm trying to accomplish?

Thanks
By: Carey
Date: 2014-03-03
Time: 16:21

Re: if - then and newline

Found a workaround:

[AddressA][AddressB;if [val]!='';then '
'][AddressB]

That way it will only show the carriage return if AddressB is not blank, and then it shows AddressB (and if it's blank, it just stays blank)
By: Skrol29
Date: 2014-03-04
Time: 22:35

Re: if - then and newline

What is the nature of your template ? Text, Html, Docx, ...