I will eventually install Panels to accomplish this. But I can't at this time. I want to allow an editor to display a right sidebar menu on any page when they want by checking a Single on/off checkbox . I added a CCK field to the Page type - Boolean -Single on/off checkbox. I am using Drupal 7.43 on Centos 7 and php 5.4
There is a php block invoke inside another php that checks if a cck field is not null. The first php is looking at the Boolean field 'field_hide_sidebar_menu' to see if it is null or not checked. If it is null it will display the block. This is not working. I have used 'if!empty' before to check if an image field is null and it works. Now I want it to check if the Boolean is checked or not checked so do I need to write this in a different way to check if the Boolean value is on or off - equal to 1 or equal to 0. Here is my code:
<?php if (!empty($entity['field_hide_sidebar_menu'])): ?> <div id="myclass">
<h2>Menu</h2> <?php $block = module_invoke('views', 'block_view',
'menu_sidebar-block_1'); print render($block['content']);?></div><?php
endif; ?>