PHP code (functions.php)
$main = $db_sql->query_array("SELECT catid,titel,subcat,startorder FROM $cat_table WHERE catid='$subcat'");
$tpl->register('category_title',stripslashes($main['titel']));
$tpl->register('category_id',$main['catid']);
So I want to add an if statement where if {category_id} is not 0 then do the following code
<img src="{GRAFURL}/{category_id}.jpg" alt="{category_title}" width="50" height="50" border="0" align="middle" /> {category_title}
what would be the correct syntax?
need more code still for the html file?
HTML doesn’t have dynamic features like if-statements. Think of HTML as a language to define a layout – unchangeable using HTML itself.
This should do the trick:
In case you need to add client-side dynamic features to your HTML-pages, have a look at jQuery or jQuery UI.