ITX with multiple templates?

From: Date: Thu, 14 Nov 2002 16:46:24 +0000
Subject: ITX with multiple templates?
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-2723@lists.php.net to get a copy of this message
Hello, i´m using ITX for building a navigation. The navigation comes from a database. <phpcode> This is my PHP code $tpl->loadTemplateFile("navi_temp.php"); $query2 = "SELECT * FROM wd_Category2nd ORDER by position"; $uResult2 = $db->query($query2); while ($uRow2 = $uResult2->fetchRow()){ if ($uRow2[0]==$ndpid){ $tpl->setCurrentBlock("Navi_Category2nd_Active"); $tpl->setVariable("Cat2Active", $uRow2[5]); $tpl->parseCurrentBlock("Navi_Category2nd_Active"); } else{ $tpl->setCurrentBlock("Navi_Category2nd_InActive"); $tpl->setVariable("Cat2InActive", $uRow2[5]); $tpl->parseCurrentBlock("Navi_Category2nd_InActive"); } } $tpl->show(); $db->disconnect(); </phpcode> This is the templatefile [navi_temp.php]: <template> <!-- BEGIN Navi_Category2nd_Active --> <tr> <td><a href="#">{Cat2Active}</a></td> </tr> <!-- END Navi_Category2nd_Active --> <!-- BEGIN Navi_Category2nd_InActive --> <tr> <td><a class="inactivelink" href="#">{Cat2InActive}</a></td> </tr> <!-- END Navi_Category2nd_InActive --> </template> Now the problem is, that the active Link always is on top and not in the order by pid. Can i solve the problem by using 2 templates, if yes, where can i find examples? Here is the link, mabe this is more clearer. http://www.thier6.de/itx/index.php http://www.thier6.de/itx/index.phps http://www.thier6.de/itx/template/navi_temp.phps THX Frank Thiel

« previous php.pear.general (#2723) next »