HTML interesse |
|
Hoi,
Ik ben net met templatepower begonnen en het volgende wilt niet.
Hij laat dus beiden blokken zien als output terwijl hij enkel block: test_ja zou moeten laten zien.
test.tpl
<!-- START BLOCK: test_ja -->
<div id="content">
<fieldset class="fieldset">
<legend>Test ja</legend>
<div class="t_content">
{inhoud}
</div>
</fieldset>
</div>
<!-- END BLOCK: test_ja -->
<!-- START BLOCK: test_nee -->
<div id="content">
<fieldset class="fieldset">
<legend>Test nee</legend>
<div class="t_content">
{inhoud}
</div>
</fieldset>
</div>
<!-- END BLOCK: test_nee -->
<!-- START BLOCK: test_ja --> <div id="content"> <fieldset class="fieldset"> <legend>Test ja</legend> <div class="t_content"> {inhoud} </div> </fieldset> </div> <!-- END BLOCK : test_ja --> <!-- START BLOCK: test_nee --> <div id="content"> <fieldset class="fieldset"> <legend>Test nee</legend> <div class="t_content"> {inhoud} </div> </fieldset> </div> <!-- END BLOCK : test_nee -->
En dan test.php:
<?PHP
error_reporting(E_ALL ^ E_NOTICE);
include("includes/php/include.inc.php");
$content = "".$site['url']."theme/".$site['theme']."/test.tpl";
include("includes/php/header.inc.php");
$var = "ja";
if($var == "ja"){
$tpl->newBlock("test_ja");
$tpl->assign("inhoud", "ja");
}
else{
$tpl->newBlock("test_nee");
$tpl->assign("inhoud", "".$var."");
}
include("includes/php/footer.inc.php");
?>
<?PHP include("includes/php/include.inc.php"); $content = "".$site['url']."theme/".$site['theme']."/test.tpl"; include("includes/php/header.inc.php"); $var = "ja"; if($var == "ja"){ $tpl->newBlock("test_ja"); $tpl->assign("inhoud", "ja"); } else{ $tpl->newBlock("test_nee"); $tpl->assign("inhoud", "".$var.""); } include("includes/php/footer.inc.php"); ?>
|