Categories > TinyButStrong general >

sub block

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: era
Date: 2016-03-10
Time: 10:03

sub block

Hi all,

I've got some troubles in using sub-blocks that last time and I think I need some help :)

I'm using a large block with many information and many sub blocks.
Typically I have a structure like :
   'key1' => 'val1'
   'key2' => 'val1'
   'key3' => array(array('subkey1'=>'subval1'))
   'key4' => array(array('subkey2'=>'subval2'))
   'key5' => array(array('subkey3'=>'subval3'))
   'key6' => array(array('subkey4'=>'subval4'))

But with that number of sub blocks (In my real structure I have like 10 sub-blocks), the template is going to be a little confuse if I have to declare (event if that works well):

My question is, can we do something to have this in the template:

I'm asking that because if I can handle the template side, it's not the case of all people and I'm trying to simplify that !

Thank for your time :)
By: era
Date: 2016-03-10
Time: 15:25

Re: sub block

After some research, I see a post where Skrol29 advices to do some str-replace in the php side to make template easier.
$TBS->Source = str-replace('[blockLabel]','[realBlock]');
By: Skrol29
Date: 2016-03-11
Time: 00:52

Re: sub block

By: era
Date: 2016-03-11
Time: 12:04

Re: sub block

My answer was good until I find that sub-blocks are limited to 8.

When I use to declare nine or more sub-blocks after height they are not take...

Do you have a tip to avoid that?
By: era
Date: 2016-03-11
Time: 15:17

Re: sub block

Forget that, it was a mistake.
There is not limit, just don't forget to have continue sub (1,2,3,4,...) and not (1,2,4,...).

For my stupidity I share a little tip that I do for capture the error into an html file instead of redirect on a error page. It prevent also from downloading a corrupt file (due to error).

        //Error management
            $response = new Response();
            $response->headers->set('Content-disposition', 'filename=error.html');
            return $response;
            $TBS->Show(OPENTBS_DOWNLOAD, $output_file_name); // Also merges all [onshow] automatic fields.