I have found a solution in "Hide a view if less than N results" for hiding the view by using the template.php file.
However I need to show a certain block also, the block is already in the correct region it would just need 'switching on' for this page.
Would it be possible to provide a callback inside the following code from the link posted above
function MY_THEME_NAME_preprocess_views_view(&$vars) {
if ($vars['display_id'] == 'MY_DISPLAY_ID' && count($vars['view']->result) < 1) {
$vars['view']->result = NULL;
}
}
To a function which turned the block on
Note: I am just starting module development.
edit: I'm now thinking that this would need to be done inside a custom module as it might be too late to turn the block on from the template.php file. If someone could clarify this.
block
that you're talking about aview block
or aregular/normal block
? – No Sssweat Oct 25 '16 at 8:25