Posted By

lexx on 02/16/09


Tagged

Blocks drupa


Versions (?)

Show Block Depending on Content Type


 / Published in: PHP
 

  1. <?php
  2. $types = array('blog','story','articles_links'); // put your allowed types in here, one or more.
  3. $showit = FALSE;
  4.  
  5. if (arg(0) == 'node' && ctype_digit(arg(1)) && is_null(arg(2))) {
  6. $node = node_load(arg(1));
  7. if ($node && in_array($node->type, $types)) {
  8. $showit = TRUE;
  9. }
  10. }
  11. return $showit;
  12. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: kurokikaze on March 3, 2009

The tag should be "Drupal", i suppose :)

You need to login to post a comment.