Categories > OpenTBS general LibreOffice >

Display content of a array

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: deStrO
Date: 2012-06-14
Time: 11:02

Display content of a array

Hello !

I'm using the TBS plugin to generate doc and I'm blocking in a point.

I have an array like this:
Array
(
    [0] => Array
        (
            [date] => 2012-04-19
            [start_hour] => 11:30
            [end_hour] => 12:30
        )

    [1] => Array
        (
            [date] => 2012-04-19
            [start_hour] => 10:00
            [end_hour] => 11:00
        )

    [2] => Array
        (
            [date] => 2012-04-18
            [start_hour] => 10:00
            [end_hour] => 11:00
        )

    [3] => Array
        (
            [date] => 2012-04-20
            [start_hour] => 09:00
            [end_hour] => 10:00
        )
   ...

)

And here is my template:
[tickets;block=begin;sub1][tickets_sub1;block=begin]- [tickets_sub1.date] (de [tickets_sub1.start_hour] à [tickets_sub1.end_hour])[tickets_sub1;block=end]
[tickets;block=end]

But I still get an error:
TinyButStrong Error in block's definition [tickets...]: at least one tag corresponding to end is not found. Check opening tags, closing tags and embedding levels.

Anybody got an tips for me ? =)

Thanks !
By: Skrol29
Date: 2012-06-14
Time: 23:58

Re: Display content of a array

Hello deStrO,

Your TBS tags seems properly closed despite the the TBS error.
This may happen if some text formating is splitting the TBS tags in the inner XML.

For example
[tickets;block=end]
may be split like this :
<text:p>[tickets;block</text:p>=<text:p>end]</text:p>

You can check this by using the OpenTBS debug mode.
See http://www.tinybutstrong.com/plugins/opentbs/tbs_plugin_opentbs.html#debugmode

If the TBS tag is split by formating, then you can repair it by doing:
1) select the TBS tag
2) copy the selection to the clipboard
3) do a Menu "Edit",  "Past special...", "Unformatted text"