Categories > TinyButStrong general >

problem with sub-blocks using apostrophes in parameter

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: sbs
Date: 2007-10-23
Time: 01:25

problem with sub-blocks using apostrophes in parameter

I've been using TBS to great success for a while now, and have finally hit a problem i can't find a solution to in the forums or docs. If a parameter (array key) for my sub-block has an apostrophe, it doesn't get merged. I've tried inserting htmlconv=esc in various places but it doesn't make a difference. Here's the code:

PHP:
$covers = array (
  'Love' =>
  array (
    'Blue' =>
    array (
      0 =>
      array (
        'id' => 'VTMKU5LBCS000000',
      ),
    ),
    'Red' =>
    array (
      0 =>
      array (
        'id' => 'X6JHZZTNO3000000',
      ),
      1 =>
      array (
        'id' => 'X6JHZZTNO3000000',
      ),
      2 =>
      array (
        'id' => 'X6JHZZTNO3000000',
      ),
    ),
  ),
  'Mother\'s Day' =>
  array (
    'Blue' =>
    array (
      0 =>
      array (
        'id' => 'VTMKU5LBCS000000',
      ),
    ),
    'Red' =>
    array (
      0 =>
      array (
        'id' => 'X6JHZZTNO3000000',
      ),
    ),
    'Green' =>
    array (
      0 =>
      array (
        'id' => 'S9Z47ME68M000000',
      ),
      1 =>
      array (
        'id' => 'X6JHZZTNO3000000',
      ),
      2 =>
      array (
        'id' => 'X6JHZZTNO3000000',
      ),
    ),
  ),
);

$TBS = new clsTinyButStrong;
$TBS->LoadTemplate("test.html");
$n0 = $TBS->MergeBlock('rb','array','covers') ;
$n1 = $TBS->MergeBlock('mb','array',"covers[%p1%]") ;
$n2 = $TBS->MergeBlock('bx,ba','array',"covers[%p1%][%p2%]") ;
HTML:
  [rb;block=begin]   
  <h1>[rb.$]</h1>
  <table>
    <tr><td>
        <h2>[mb.$;block=tr;p1=[rb.$;htmlconv=esc]]</h2>
        <table>
          <tr>
            <td><i>[bx_1.id;block=td]</i>
            </td>
            <td><i>[bx_2.id;block=td]</i>
            </td>
            <td><i>[bx_3.id;block=td]</i>
            </td>
            <td><i>[bx_4.id;block=td]</i>
            [bx;block=tr;serial;p1=[rb.$];p2=[mb.$];]
            </td>
          </tr>
        </table>
    </td></tr>
  </table>
  [rb;block=end]

By: Skrol29
Date: 2007-10-24
Time: 18:20

Re: problem with sub-blocks using apostrophes in parameter

If you escape the key, you should use delimiters.
p1='[rb.$;htmlconv=esc]'