[documentation] [Documentation bug] hook_block example confusing

webchick drupal-docs at drupal.org
Sat Sep 16 03:24:18 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:   webchick
 Status:       active

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.




webchick



More information about the documentation mailing list