Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By laden_maiden on
hi all, im stuck right there, my block doesnt show on the blocks admin page. i use Drupal 7
i created a module using block api. my hook block_info looks like:
function datos_inicio_block_info() {
$blocks = array ();
$blocks ['datos_inicio_block'] = array (
'info' => 'datos_inicio',
'cache' => DRUPAL_NO_CACHE
);
return $blocks;
}
and my hook block_view looks like:
function datos_inicio_block_view($delta = '') {
if ($delta = 'datos_inicio_block') {
something...
something...
something...
something...
something...
something...
return array (
'content' => array (
array (
'#theme' => 'item_list',
'#items' => $datos
)
)
);
}
}
and my block.info looks like:
name = block_datos_inicio
description = "a block"
package = Modelos
core = 7.x
files[] = block_datos_inicio.module
files[] = ../../dominio/M.php
files[] = ../../dominio/C.php
i've tried clear the drupal cache, disable->uninstall->clearcache->install->enable, change modules names, change hook functions names, but nothing. i cant see the block in blocks admin page. i also checked the blocks table in db, but there are no entry for that block.
what can i do? throw away drupal and become a farmer? :D
thanks in advance!
Comments
What's the machine name of
What's the machine name of your module? From the .info file, it looks like it might be block_datos_inicio. If so, you need to add
block_ to the start of your function names.
yes yes yess! you are the one
yes yes yess! you are the one! that was my problem!
thank you very much!