By issetname on
Hi community, I need hide block (knowing id 'animalsblock-test') in the pages with the field "animals" with selected "Cats" - how to do it?
My code field validation:
if ($content['field_type_animals'] != NULL) {
if ($field_type_animals['0']['value'] === 'Cats') {
//Here it is necessary to hide block
}
else {
//Here it is necessary to show block
}
}
Comments
I'm assuming that field_type
I'm assuming that field_type_animals is a field on a node.
Implement hook_block_view_MODULE_DELTA_alter(). Do this:
Contact me to contract me for D7 -> D10/11 migrations.
For example to Hide a Block for a certain content type
For example to Hide a Block for a certain content type