Categories > OpenTBS general >

Nested subs in LibreOffice text

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: fred
Date: 2017-02-23
Time: 10:46

Nested subs in LibreOffice text

I'm trying to make nested in subs in LibreOffice text, in order to use different levels of titles.
1 DomA
1.1 Project A
   - AE1
   - AE2
1.2 Project B
   - AE3
   - AE4
2 DomB
2.1 Project C
... and so on

Here's my template
1 [myBlock.domaine;strconv=no;enlarge=text:p]
1.1 [myBlock_sub1.nom]
- [myBlock_sub1_sub1.nom]

and here's my data:
global $data;
$data = array(
    array('domaine'=>'Dom A', 'projet'=>[
                           0=>array( 'nom'=>'Project I', 'ae'=>[
                        0=>array( 'nom'=>'AE 1','desc'=>'titi'),
                        1=>array( 'nom'=>'AE 2.3','desc'=>'tur lu tutu')
                 ,1=>array( 'nom'=>'Project II', 'ae'=>[
                        0=>array( 'nom'=>'AE  4.5','desc'=>'titi'),
                        1=>array( 'nom'=>'AE  4.9','desc'=>'tur lu tutu')
        array('domaine'=>'Dom B',  'projet'=>[
                       0=>array( 'nom'=>'Project III', 'ae'=>[
                        0=>array( 'nom'=>'AE tric','desc'=>'titi'),
                        1=>array( 'nom'=>'AE troc','desc'=>'tur lu tutu')
I use MergeBlock
$TBS->MergeBlock('myBlock', $data);
And the error message:
TinyButStrong Error in block's definition []: at least one tag corresponding to end is not found. Check opening tags, closing tags and embedding levels.

Without the sub1_sub1 level the template works fine.

I don't understand how to define the second level.
Please help.
By: Skrol29
Date: 2017-02-23
Time: 13:01

Re: Nested subs in LibreOffice text


In your snippet, there is no "block=begin" for block "myBlock_sub1_sub1".

Bythe way, for LibreOffice and Ms Office, it is better to use the relative syntax for fields (block=tbs:p) instead of the absolute syntax (block=begin, block=end).
By: fred
Date: 2017-02-23
Time: 22:02

Re: Nested subs in LibreOffice text


Thanks for the help. It works!
I'll consider the relative syntax (block=tbs:p). Tomorow I'll try something like this:
1 [myBlock.domaine;strconv=no;enlarge=text:p;block=tbs:p;sub1=(projet)]
1.1 [myBlock_sub1.nom;block=tbs:p;sub1=(ae)]
- [myBlock_sub1_sub1.nom]