I have some blocks where I have edited the Page Specific Visibility settings and have added PHP code to where the blocks will display if the content is located in a certain vocabulary. However, when I do this, anonymous and authenticated users cannot view the block. Here's my PHP code:

  // This snippet returns TRUE if the node we are
  // currently viewing is tagged with a term which belongs
  // to the 'desired_vocab'.

  $desired_vocab = 13; // put here the vocabulary ID you're interested in

  if ( arg(0) == 'node' and is_numeric(arg(1)) ) {
    // Yes, we're viewing a node.

   $node = node_load(arg(1)); // cached
    foreach ($node->taxonomy as $term) {
      if ($term->vid == $desired_vocab) {
        return TRUE;
      }
    }   
  }
  return FALSE;

Do I need to add something is here to allow people besides admin users to view these blocks? I want everyone to see these blocks. Any ideas?

Comments

tricia@drupal.org’s picture

Try checking 'Block specific settings' and make sure that you have made block available to all users.

ebrophy’s picture

For these particular blocks (which some refer to menus), when you click on configure...only "User Specific Visibility Settings" and "Page Specific Visibility Settings" show up. And there's nothing about making the block available to all users. I'm using Drupal 4.7.6