Hello, wonder if someone could take a look att this PHP-code. Following code is made by
http://www.beesign.com and its used in the template to show a content block only if there are any content in it.
I would very much have the same features but insted output a specific section. That is, it takes a look at the section and write it out if there are content in the section.
<?php ob_start();
page_content(1);
$content1=ob_get_contents();
ob_end_clean();
?>
<?php if ($content1<>"") {
echo "<div id=\"name\">\n";
echo $content1;
echo "\n</div><!-- close div#name -->\n";
}?>
I am sure it is trivial to any PHP-coder. The content needs to be stored in an variable but i can not figure out how? Manage to do it with a menu though so I am sharing this below.
Menu shows only if there are content:
<?php ob_start();
show_menu2(1,SM2_ROOT+1);
$content1=ob_get_contents();
ob_end_clean();
?>
<?php if ($content1<>"") {
echo "<div id=\"left1\">\n";
echo "<div id=\"meny\">\n";
echo $content1;
echo "\n</div><!-- close meny-->\n";
echo "\n</div><!-- close left1-->\n";
}?>