IntegratedTemplate -> Blocks problem
| From: | Michael Ochs | Date: | Wed, 15 Oct 2003 14:18:13 +0000 |
| Subject: | IntegratedTemplate -> Blocks problem | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8447@lists.php.net to get a copy of this message | ||
Hi,
I've got a problem with the blockmanagement. I think it's my fault because
in another script of mine it works perfect.
The Template is like this:
[code]
<BR>
<!-- BEGIN list -->
<BR>
<a name="{list_letter}"><div
style="background-color:#EEEEEE;">{list_letter}</div><BR>
<!-- BEGIN movies -->
<a href="#{list_letter}"
onClick="window.open();">{movie_name}</a><BR>
<!-- END movies -->
<a href="#top"><div
style="background-color:#EEEEEE;">top</div></a><BR>
<!-- END list -->
<BR>
[/code]
And this is the PHP-code:
[php]
include("include/template.php");
include("include/config.php");
$tpl = new IntegratedTemplate($suburl."template");
$tpl->loadTemplatefile("liste.html");
$letter=A;
for($i=0;$i<26;$i++) {
$select="SELECT
ID,name FROM $tabelle WHERE name LIKE
'".$letter."%'
".$cathstring."ORDER BY name ASC";
$select=mysql_query($select);
$tpl->setCurrentBlock("list");
$tpl->setVariable(array("list_letter"=>$letter));
$tpl->parseCurrentBlock();
while($ergebnis=mysql_fetch_array($select)) {
$tpl->setCurrentBlock("movies");
$tpl->setVariable(array("movie_name"=>$ergebnis['name'],"movie_id"=>$ergebni
s[ID],"list_letter"=>$letter));
$tpl->parseCurrentBlock();
}
$letter++;
}
[/php]
But what the script did: It puts the block "movies" UNDER the Block "list"
and not inside this block?!? Why?
Thanks for help,
Michael