Display content block or not

Bennie_wijs

Oke,

Will try the code from Ruud and will look at the template "Andreas 06 - falling leaves"

Thanks for the response   :-D
I believe what I want to Believe

Ruud


<?php 
ob_start
(); 
page_content(2); //When contentblock 2 is used
$content2=ob_get_contents();  
ob_end_clean(); 
if (
$content2<>"") { ?>

   <div class="someclass">
           <?php echo $content2?>
   </div>
<?php ?>


This will work when no content block (2) is added to the page, otherwise there will be some data (about 50 bytes) even on empty blocks.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Stefek

Yes.
This is possible.

Please use the search.

One hint: the template "Andreas 06 - falling leaves" hast this functionality built in.

Regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Bennie_wijs

Hello all,

Is there a way to check if a content block will be filled or not??.

More info:
I am building a new template and I am making a display block for a second content block.
But I want this block to be hidden unless the second content block has data.

Can this be done???
I believe what I want to Believe