Drupal 7 block api, is this custom module correct? This is my first time attempting at writing a custom module i had a quick look over the api but forgive me if its wrong

We have been having some small issues regarding the drupal core blocks, the main page content block completely disregards the weigh assigned to it, and we are stumped for clues, no help or ideas have been found from posting on drupal or extensively searching google.

The final option we have is to manually overwrite the weight, i threw this together quickly

 &lt;?php
 funtion hook_block_info_alter() {
$blocks['Main page content'] = array(
    'weight' =&gt; ('-9999'),
    );
 }
 ?&gt;


Would that successfully overwrite the weight of the main page content block?
Very nearly, but not quite.


You're missing the function arguments in your hook implementation, so there's nothing there to actually alter.
The blocks array is keyed by module, then block delta, so you would need to access the block using those instead of the title as you currently are.
You're trying to overwrite the system main block in it's entirety rather than changing a property on it.
You've spelt function wrong ;)


Try:

function MYMODULE_block_info_alter(&amp;$blocks, $theme, $code_blocks) {
  $blocks['system']['main']['weight'] = -9999;
}