Is there a way for plugin programmers to cancel the output of a bean under certain conditions?

For example, if a Bean plugin contains a query but no results are given - the example modules currently still output the block with a title. In the case of bean_tax, I am outputting "No Results" but it would be nice to just not show the block at all in this case.

Is there a return command that would cancel the block from printing to the page? I have tried a few things to no avail...

unset($bean);
unset($content);
return FALSE;

But it still returns the block with only a title.

Comments

indytechcook’s picture

Status: Active » Fixed

You can just override the tpl file bean.tpl.php in your theme.

You can also use theme_preprocess_entity

The title might also be coming form the block and not the bean. You can set the bean title to just like a normal block.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.