Categories > OpenTBS with DOCX >

Removing empty lines in docx template

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: benstinton
Date: 2015-05-18
Time: 16:18

Removing empty lines in docx template

I have a docx with the following tags:
[p;block=begin;sub1=(descriptionArray)][p.startDate] to [p.endDate]    [p.companyName]
    [p.roleTitle]
[p_sub1.line;block=begin;sub1=(listitem);bmagnet=tbs:listitem][p_sub1.line; magnet=tbs:listitem]
•    [p_sub1_sub1.line;block=tbs:listitem]
[p_sub1; block=end]
[p; block=end]

but I have an issue in that empty lines are visible is p_sub1.line is empty. I have tried various variations with magent but am not getting anywhere. Can anyone suggest where I am going wrong?

Thanks
By: Skrol29
Date: 2015-05-18
Time: 23:45

Re: Removing empty lines in docx template

Hi Benstinton,

Did you tried with the relative syntax for block ?

[p.startDate;block=tbs:p+tbs:p+tbs:p+tbs:listitem;sub1=(descriptionArray)] to [p.endDate]    [p.companyName]¶
[p.roleTitle]¶
[p_sub1.line;block=tbs:p+tbs:listitem;sub1=(listitem)]¶
•    [p_sub1_sub1.line;block=tbs:listitem]



By: benstinton
Date: 2015-05-19
Time: 16:19

Re: Removing empty lines in docx template

Thanks for the response. This has highlighted two issue, the last two lines don't render so I think I have got a problem with the structure of my data (see below):
Array
(
    [0] => Array
        (
            [startDate] => Sep 2008
            [endDate] => present
            [companyName] => Company Name
            [roleTitle] => Business Analyst
            [descriptionArray] => Array
                (
                    [1] => Array
                        (
                            [listitem] => Array
                                (
                                    [0] => Array
                                        (
                                            [line] => Bullet Point
                                        )
                                    [1] => Array
                                        (
                                            [line] => Bullet Point
                                        )
                                )
                        )
                    [3] => Array
                        (
                            [line] => Normal line
                            [listitem] => Array
                                (
                                    [0] => Array
                                        (
                                            [line] => Bullet Point
                                        )
                                    [1] => Array
                                        (
                                            [line] => Bullet Point
                                        )
                                )
                        )
                )
        )
    [1] => Array
        (
            [startDate] => May 2008
            [endDate] => Jul 2008
            [companyName] => Company Name
            [roleTitle] => Project manager - managing
            [descriptionArray] => Array
                (
                    [2] => Array
                        (
                            [line] => Normal line
                            [listitem] => Array
                                (
                                    [0] => Array
                                        (
                                            [line] => Bullet Point
                                        )
                                )
                        )
                    [4] => Array
                        (
                            [line] => Normal line
                            [listitem] => Array
                                (
                                    [0] => Array
                                        (
                                            [line] => Bullet Point
                                        )
                                    [1] => Array
                                        (
                                            [line] => Bullet Point
                                        )
                                )
                        )
                )
        )
)
Does, this look right?

and also the block seems to merge into the rest of my document. My template looks like this

Career History

[p.startDate;block=tbs:p+tbs:p+tbs:p+tbs:listitem;sub1=(descriptionArray)] to [p.endDate]    [p.companyName]¶
[p.roleTitle]¶
[p_sub1.line;block=tbs:p+tbs:listitem;sub1=(listitem)]¶
•    [p_sub1_sub1.line;block=tbs:listitem]

Interests

•    [c.hobbies;block=tbs:listitem;]


and the positions start appearing under Interests. Is there any other way to tell the template where the block should end?
By: Skrol29
Date: 2015-05-25
Time: 00:37

Re: Removing empty lines in docx template

The data looks correct except that a item "line" i missing with the first item "listitem".

What result do you have ?