TinyButStrong - the PHP Template Engine
Categories > OpenTBS with ODT >

Delete Line and Picture

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

By: John
Date: 2015-08-08
Time: 01:42

Delete Line and Picture

Hello,

I am just getting started with TBS and OpenTBS and I have 2 questions:

1. I have an address block in my template which looks like this:
Name
StreetAddress1
StreetAddress2
City, State ZipCode

If StreetAddress2 = '' then I want to remove the entire line and push the City, State ZipCode up one line. How do I do that?

2. I have an image in my template but I only want to show it when a checkbox is checked on my website. For example, if checkbox is checked then $finalRequest = 'yes'. If finalRequest = yes then show image.

Thank you in advance.

John
By: Skrol29
Date: 2015-08-11
Time: 00:20

Re: Delete Line and Picture

Hi John,

1) See parameter magnet which is done for that.
http://www.tinybutstrong.com/manual.php#html_field_prm_magnet

2) This can be done with a conditional display.
See
http://www.tinybutstrong.com/manual.php#html_conditional
By: John
Date: 2015-08-12
Time: 17:37

Re: Delete Line and Picture

Thanks so much for the response, I greatly appreciate it.

I thought the correct parameter was magnet but in reading the link you provided it appears I need to specify an html tag surrounding the content I am hiding/showing. I am trying to hide/show content in and ODT file. What tag am I trying to delete in the template file, a paragraph tag? Here is the address block in my ODT template:
[onshow.insuredName]
[onshow.mailingAddress]
[onshow.mailingAddress2]
[onshow.mailingCity], [onshow.mailingState] [onshow.mailingZip]
I want to delete [onshow.mailingAddress2] if the value is ''. Can you let me know what tag I am supposed to use to perform the hide/show?

I am looking into the conditional display next.

John
By: Skrol29
Date: 2015-08-14
Time: 19:31

Re: Delete Line and Picture

The best way is to use a different paragraph for each line of the address. Then you can use "magnet=tbs:p".
You can adjust the properties of the paragraph in order to have the height and the margins above a under to look like a simple line break.