Going by the 6.X API here http://api.drupal.org/api/function/hook_block which states
# If $op is 'view': return an array which must define a 'subject' element and a 'content' element defining the block indexed by $delta.
This functionality is used/assumed in all of the phpsnippets given on how to generate blocks via code (see example below). I'm not sure when the functionality was changed, or why ... but I can find no mention of it in any of the documentation.
....
Additionally, as I delved into it I had questions about the design decision of the boxes/block table structure and normalization.
Table boxes has the following columns
bid
body
info -> This is 'Block Description' in the admin section and what is used in list of modules
format
Table blocks stores the title -> this is the 'title' that is used when the box/block is rendered, and what is refered to in API as the return element 'subject'
As far as I can tell , if you configure a block under a specific theme, the title of all the blocks (one for each theme) is changed. So why isn't title just stored in table boxes?
Attached is the modification I made so that something similar can work
$block = module_invoke('block', 'block', 'view', 1);
$output .= $block['subject'];
$output .= $block['content'];
I am brand new to drupal and still trying to get a grasp of things , if I am misunderstanding some design spec I apologize but just trying to make sence of the API and examples given.
| Comment | File | Size | Author |
|---|---|---|---|
| block-D6.diff | 688 bytes | shaneforsythe |
Comments
Comment #1
gábor hojtsyThe title is something which is a user setting of all blocks provided by Drupal. You can override any block title. Therefore it is not the job of the block module to return that title in the hook. Granted it would be logical to return something in the subject key.
Why is this a critical issue?
Comment #2
gábor hojtsyAlso, looks like a duplicate of the much more reviewed and discussed - and way older #126070: module_invoke('block', 'view', ...) doesn't return subject.