inbyronwetrust Posted August 3, 2007 Share Posted August 3, 2007 Im trying to display a specific block in a drupal. I only want to display when enabled and not everytime the page is visited. I have: <?php $block = module_invoke('block', 'block', 'view', 2); print $block['content']; ?> although im confused on this code that will excute when block is enable. (because the block is showing wheather its enabled or not.) so maybe I should look for a hide if not enabled? some kind of if statement like: if($block['content']==enable){ $block = module_invoke('block', 'block', 'view', 2); print $block['content'];} Link to comment https://forums.phpfreaks.com/topic/63199-post-if-question/ Share on other sites More sharing options...
Fadion Posted August 4, 2007 Share Posted August 4, 2007 Guess u should ask this question to the drupal community forums or smth. Anyway, what do u mean 'to display it when enabled'? The if statement u wrote cant make it as ure checking '$block' without initializing it with 'module_invoke'. Link to comment https://forums.phpfreaks.com/topic/63199-post-if-question/#findComment-315305 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.