Strong Like Bull
Strong Like Bull

Reputation: 11297

Why won't my block statement work in Drupal 7?

    $block['content'] .='<span style="display:none" class="tc_msg">YOU ARE NOW LOGGED OFF</span>';
  $block['content'] .='</span>';
  return $block;

I see nothing on screen

Upvotes: 0

Views: 114

Answers (1)

DeveloperWeeks
DeveloperWeeks

Reputation: 272

For one thing, you are closing the span twice. Second, the style="display:none;" hides that whole span.

Since you are returning html, I assume you are placing this inside the hook_block_view() http://api.drupal.org/api/drupal/modules%21block%21block.api.php/function/hook_block_view/7

If the above code is all that is going into $block['content'] then try removing the . from the first .= so there is no question as to what 'content' contains.

Have you assigned this block to a region of your site, or is it sitting in the Disabled section of your block management? That would also cause you to not see it on the site.

Upvotes: 4

Related Questions