[documentation] [Documentation bug] hook_block example confusing

pwolanin drupal-docs at drupal.org
Sat Sep 16 14:53:36 UTC 2006


Issue status update for 
http://drupal.org/node/84455
Post a follow up: 
http://drupal.org/project/comments/add/84455

 Project:      Documentation
 Version:      <none>
 Component:    Documentation in CVS
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  webchick
 Updated by:   pwolanin
 Status:       active

Yes, this doesn't seem right as an example.  I didn't even realize the
region could be hard-coded.




pwolanin



Previous comments:
------------------------------------------------------------------------

Sat, 16 Sep 2006 03:24:18 +0000 : webchick

The example for the list op:


  if ($op == 'list') {
    $blocks[0] = array('info' => t('Mymodule block #1 shows ...'),
      'weight' => 0, 'enabled' => 1, 'region' => 'left');
    $blocks[1] = array('info' => t('Mymodule block #2 describes ...'),
      'weight' => 0, 'enabled' => 0, 'region' => 'right');
    return $blocks;
  } 


Seems to imply you should hard-code the enabled and region for each
block. Of course doing this means that you can't change it with the
admin interface. Confusing for new developers.






More information about the documentation mailing list