I've gotten my squares to appear, and I wanted to add additional rectangles(square_piece) on another location. Yet I'm getting an error.
Even if I remove all of square, and leave only square_piece I still get the error.
square by itself doesn't give an error message.
Error:
Template Error: set_block: unable to set block square_piece.
Halted.
.tpl:
.view.php
.css
Even if I remove all of square, and leave only square_piece I still get the error.
square by itself doesn't give an error message.
Error:
Template Error: set_block: unable to set block square_piece.
Halted.
.tpl:
Code: Select all
<div id="board">
<!-- BEGIN square -->
<div id="square_{X}_{Y}" class="square" style="left: {LEFT}px; top: {TOP}px;"></div>
<!-- END square -->
<!-- BEGIN square_piece-->
<div id="square_piece_{SX}_{SY}" class="square_piece" style="left: {SLEFT}px; top: {STOP}px;"></div>
<!-- END square_piece-->
<div id="tokens">
</div>
</div>
Code: Select all
$this->page->begin_block( "backgammontest_backgammontest", "square" );
$hor_scale = 59;
$ver_scale = 35;
for( $x=1; $x<=13; $x++ )
{
for( $y=1; $y<=5; $y++ )
{
$this->page->insert_block( "square", array(
'X' => $x,
'Y' => $y,
'LEFT' => round( ($x-1)*$hor_scale+9-$x),
'TOP' => round( ($y-.94)*$ver_scale )
) );
}
for( $y=1; $y<=5; $y++ )
{
$this->page->insert_block( "square", array(
'X' => $x,
'Y' => $y,
'LEFT' => round( ($x-1)*$hor_scale+9-$x),
'TOP' => round( ($y+4.7)*$ver_scale )
) );
}
}
$this->page->begin_block( "backgammontest_backgammontest", "square_piece" );
$hor_scale = 1;
$ver_scale = 5;
for( $x=1; $x<=13; $x++ )
{
for( $y=1; $y<=1; $y++ )
{
$this->page->insert_block( "square_piece", array(
'SX' => $x,
'SY' => $y,
'SLEFT' => round( ($x-1)*$hor_scale+9-$x),
'STOP' => round( ($y-.94)*$ver_scale )
) );
}
for( $y=1; $y<=1; $y++ )
{
$this->page->insert_block( "square_piece", array(
'SX' => $x,
'SY' => $y,
'SLEFT' => round( ($x-1)*$hor_scale+9-$x),
'STOP' => round( ($y+4.7)*$ver_scale )
) );
}
}
$hor_scale = 1;
$ver_scale = 5;
for( $x=1; $x<=13; $x++ )
{
for( $y=1; $y<=1; $y++ )
{
$this->page->insert_block( "rectangle", array(
'SX' => $x,
'SY' => $y,
'SLEFT' => round( ($x-1)*$hor_scale+9-$x),
'STOP' => round( ($y-.94)*$ver_scale )
) );
}
for( $y=1; $y<=1; $y++ )
{
$this->page->insert_block( "rectangle", array(
'SX' => $x,
'SY' => $y,
'SLEFT' => round( ($x-1)*$hor_scale+9-$x),
'STOP' => round( ($y+4.7)*$ver_scale )
) );
}
}Code: Select all
.square {
width: 32px;
height: 32px;
position: absolute;
background-color: red;
}
.square_piece{
width: 60px;
height: 176px;
position: absolute;
background-color: yellow;
opacity:0.4;
}