Jump to content

$post if question.


Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.