Display blocks conditionally

How does one code a block so that it will not display under certain circumstances, like if there is nothing to put in the block or conditionally, based on something like a user's profile attribute.  I've tried putting a test at the top of a service block method but I still end up with the block displayed.

Thanks.

Quote · 11 Jan 2013

some of the advanced page access modules in the market allow you to make blocks visible via member level and age. This may help a bit ; )

Quote · 11 Jan 2013

Normally, if you have a PHP block and don't send any output, it doesn't get displayed.

I use this on the member's home page for friend requests.

If they have a friend request, it outputs a table, otherwise, it returns '';

The block only displays when there's something to display.

http://www.mytikibar.com
Quote · 11 Jan 2013

Got it, thanks you are right. One of the blocks had a constructor so I needed to put the test there.  But otherwise all is well now.

Quote · 11 Jan 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.