NEWSBOX 05
Template
author, dd.mm.yyyy
Template is built of newsboxes. The newsboxes are placed into 4 columns in a row. The column may contain optional number of newsboxes.
row | ||||||||
column | column | column | column | |||||
newsbox | newsbox | newsbox | newsbox | |||||
newsbox | newsbox | newsbox | newsbox | |||||
newsbox | newsbox | newsbox | newsbox | |||||
/column | /column | /column | /column | |||||
/row |
Each page (News##) is shown in one newsbox.
If the page has no content (except of the H2 page name), the respective newsbox is hidden.
There is a test script for each newsbox in the template checking the length of the content.
<!-- NEWSBOX 01 -->
<?php
/*
test the content of newsbox,
if the content is longer than 9 characters,
show the newsbox. Else hide the newsbox
*/
$test = strip_tags(newsbox('news01'));
$test = str_replace(array(" ", "\r","\n", " "), '', $test);
if(strlen($test) > 9) { ?>
<?php echo '<div class="newsbox">'.newsbox('news01').'</div>';?>
<?php }else { ?>
<?php echo '<div class="hide">'.newsbox('news01').'</div>';?>
<?php } ?>