By: Owen
Date: 2016-10-11
Time: 05:40
|
Unwanted line breaksI am merging an array block that contains a number of nested sub-blocks to create a competition results doc, and while the data is populating the Word document perfectly I'm getting unwanted line-breaks depending on which sub-blocks exist in each section of the array. Apart from the block headings that start on new pages, the only line-breaks in the template are between the end of each category sub-block and the table that displays results information for that sub-block.
Single line-breaks are fine, but I'm getting 3 blank lines in some places. Is it possible to suppress extra line-breaks? Here is my template...
Here is an example of merged data - note the 3 blank lines before start of "Section: District Two" and again before "Section Winner":...
|
||||||
By: Skrol29
Date: 2016-10-13
Time: 10:11
|
Re: Unwanted line breaksHi Owen,
With TBS, it is better to favor the relative syntax. http://www.tinybutstrong.com/manual.php#html_block This is specially true with OpenTBS because the fields with "block=begin" and "block=end" can take some strange places or imply some contents like line-breaks. If your sections are table rows, then you can use "block=tbs:row", if it is paragraph you can use "block=tbs:p". |
||||||
By: Owen
Date: 2016-10-16
Time: 07:37
|
Re: Unwanted line breaksThanks for the help. I tried the relative and simplified syntax examples from your linked manual page, but didn't work for me:
...when I added XML tags to try defining each block's zone, the XML tags were ignored and remain in the merged document... and nesting of XML tags for the zones of sub-blocks didn't work for me either. Do the XML tags used as above apply to DOCX format? > If your sections are table rows, then you can use "block=tbs:row", if it is paragraph you can use "block=tbs:p". ...I understand the suggestion about not declaring absolute begin/end of each block, but couldn't find examples of relative syntax used with multiple levels of sub-blocks and don't see how I would apply the "block=tbs:row" & "block=tbs:p" to my template. Do you mean that each sub block that is declared requires either a paragraph or row declaration as well? So in my example, instead of...
I should have...
etc.? |
||||||
By: Skrol29
Date: 2016-10-16
Time: 23:24
|
Re: Unwanted line breaksHi,
Using OpenTBS you must not add your own tags, simply because that will not be XML tags. Only escaped text that will display strings. With OpenTBS you can use the relative syntax with XML that is inner. Since it's difficult to know inner XML elements, OpenTBS gives alias for you : tbs:row, tbs:p (paragraph) , tbs:page,.... For advanced XML, they is an help file: http://www.tinybutstrong.com/plugins/opentbs/xml_synopsis.html |
||||||
By: Owen
Date: 2016-11-02
Time: 06:31
|
Re: Unwanted line breaksThanks again for the response. I understand your statement about using OpenTBS aliases for inner XML elements, and have read the XML synopsis, and have been trying ever since to apply the necessary logic... but still cannot resolve the relative syntax required in the template to merge the multiple levels of (conditional) sub-blocks.
Where the explicit syntax merged all the sub-blocks perfectly (albeit with some unwanted spacing - see merged result in original post above) the relative syntax seems to result in sub-blocks being repeated a set number of times in the merged document regardless of whether each sub-block contains data or how many array elements it contains. e.g.: adding
Similarly, appending
You can see from the first post in this thread the original template with correct merge result. But changing to relative syntax it starts going wrong in the first level of sub-blocks. I can't find any similar example in the documentation that suggests the correct use of relative syntax to handle the 3 levels of sub-blocks I'm using, some of which are conditional - would you able to provide any pointers as to the required syntax in the template? The sample array I'm merging to simulate the data is:
|