Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

I have followed the instruction to create a new block here which is basically the same as here on SEhere on SE. My block is indeed created but the region is wrongly set to "none" instead of "Content Post".

In my module events.module file:

function events_block_info () { return [ 'events_list' => [ 'info' => "Events list", 'region' => 'content_post', 'visibility' => BLOCK_VISIBILITY_NOTLISTED ] ]; } function events_block_view ($delta = '') { $result = false; if ($delta == 'events_list') { /* ... do my stuff .... */ } return $result; } 

This creates a block but the region is set to "none". The drawback is I have to go on each environment and change the region manually back to "Content Post". It is inefficient.

I also find it extremely weird that the creation of a block is done this way. I would expect instead that the creation takes place in the module.install file in the hook_install() function. Maybe there is way?

I have followed the instruction to create a new block here which is basically the same as here on SE. My block is indeed created but the region is wrongly set to "none" instead of "Content Post".

In my module events.module file:

function events_block_info () { return [ 'events_list' => [ 'info' => "Events list", 'region' => 'content_post', 'visibility' => BLOCK_VISIBILITY_NOTLISTED ] ]; } function events_block_view ($delta = '') { $result = false; if ($delta == 'events_list') { /* ... do my stuff .... */ } return $result; } 

This creates a block but the region is set to "none". The drawback is I have to go on each environment and change the region manually back to "Content Post". It is inefficient.

I also find it extremely weird that the creation of a block is done this way. I would expect instead that the creation takes place in the module.install file in the hook_install() function. Maybe there is way?

I have followed the instruction to create a new block here which is basically the same as here on SE. My block is indeed created but the region is wrongly set to "none" instead of "Content Post".

In my module events.module file:

function events_block_info () { return [ 'events_list' => [ 'info' => "Events list", 'region' => 'content_post', 'visibility' => BLOCK_VISIBILITY_NOTLISTED ] ]; } function events_block_view ($delta = '') { $result = false; if ($delta == 'events_list') { /* ... do my stuff .... */ } return $result; } 

This creates a block but the region is set to "none". The drawback is I have to go on each environment and change the region manually back to "Content Post". It is inefficient.

I also find it extremely weird that the creation of a block is done this way. I would expect instead that the creation takes place in the module.install file in the hook_install() function. Maybe there is way?

edited tags
Link
avpaderno
  • 98.1k
  • 15
  • 165
  • 284
added 1 character in body
Source Link
Guillaume Bois
  • 1.1k
  • 3
  • 11
  • 28

I have followed the instruction to create a new block here which is basically the same as here on SE. My block is indeed created but the region is wrongly set to "none" instead of "Content Post".

In my module eventevents.module file:

function events_block_info () { return [ 'events_list' => [ 'info' => "Events list", 'region' => 'content_post', 'visibility' => BLOCK_VISIBILITY_NOTLISTED ] ]; } function events_block_view ($delta = '') { $result = false; if ($delta == 'events_list') { /* ... do my stuff .... */ } return $result; } 

This creates a block but the region is set to "none". The drawback is I have to go on each environment and change the region manually back to "Content Post". It is inefficient.

I also find it extremely weird that the creation of a block is done this way. I would expect instead that the creation takes place in the module.install file in the hook_install() function. Maybe there is way?

I have followed the instruction to create a new block here which is basically the same as here on SE. My block is indeed created but the region is wrongly set to "none" instead of "Content Post".

In my module event.module file:

function events_block_info () { return [ 'events_list' => [ 'info' => "Events list", 'region' => 'content_post', 'visibility' => BLOCK_VISIBILITY_NOTLISTED ] ]; } function events_block_view ($delta = '') { $result = false; if ($delta == 'events_list') { /* ... do my stuff .... */ } return $result; } 

This creates a block but the region is set to "none". The drawback is I have to go on each environment and change the region manually back to "Content Post". It is inefficient.

I also find it extremely weird that the creation of a block is done this way. I would expect instead that the creation takes place in the module.install file in the hook_install() function. Maybe there is way?

I have followed the instruction to create a new block here which is basically the same as here on SE. My block is indeed created but the region is wrongly set to "none" instead of "Content Post".

In my module events.module file:

function events_block_info () { return [ 'events_list' => [ 'info' => "Events list", 'region' => 'content_post', 'visibility' => BLOCK_VISIBILITY_NOTLISTED ] ]; } function events_block_view ($delta = '') { $result = false; if ($delta == 'events_list') { /* ... do my stuff .... */ } return $result; } 

This creates a block but the region is set to "none". The drawback is I have to go on each environment and change the region manually back to "Content Post". It is inefficient.

I also find it extremely weird that the creation of a block is done this way. I would expect instead that the creation takes place in the module.install file in the hook_install() function. Maybe there is way?

Source Link
Guillaume Bois
  • 1.1k
  • 3
  • 11
  • 28
Loading