Categories > TinyButStrong general >

Error when merging block [Array]: unsupported variable type : 'NULL'.

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: NickM
Date: 2010-12-13
Time: 07:56

Error when merging block [Array]: unsupported variable type : 'NULL'.

I have a simple array that I am using to create a menu list. The menu is created correctly, but I keep getting this error
Error when merging block [Array]: unsupported variable type : 'NULL'.
I followed the example in your website.

Here is my php
<?php
include_once('tbs_class.php');
$TBS = new clsTinyButStrong;

//variables specific to this page
$menu_select="index";
require ("menu_case.php");

$TBS->LoadTemplate('templ/index_templ.html');

$array_type1 = array('writing'=>'writing1', 'design'=>'design1', 'buy'=>'buy1', 'contact'=>'contact1');
$all_array['type1'] = $array_type1;
$TBS->MergeBlock('blk1',$array_type1);
$TBS->Show();
?>

Here is the relevant HTML:
<ul>
<li><a href="[blk1.key;block=li].php">[blk1.val;block=li]</a></li>
</ul>

It's simple enough, but I don't undersand why I am getting the error.
Any help would be appreciated.
Thanks.
By: Skrol29
Date: 2010-12-13
Time: 11:25

Re: Error when merging block [Array]: unsupported variable type : 'NULL'.

Hi NickM,

The error message tells that the name of the block is [Array]. This is strange.
This can happen if you've given an array instead of a string for the first argument of MergeBlock().

Could you check that your PHP code has not a line like:
$TBS->MergeBlock($an_array);
By: kle_py
Date: 2010-12-13
Time: 21:21

Re: Error when merging block [Array]: unsupported variable type : 'NULL'.

You might try the html template like:

<ul>
<li><a href="[blk1.$;block=li].php">[blk1.val;block=li]</a></li>
</ul>

(not use "blk1.key" !)