开发者

drupal 7 hook_form_form_id_alter

I'm trying to hook into a form with ID equal to "block-admin-configure," mymodule_form_block_admin_configure_alter(&$form, $form_state, $form_id) is not being triggered. When I use mymodule_block_view_block_admin_configure_alter(&$data, $block), it works perfectly.

My goal is to add some additional configuration options to a regular dr开发者_如何学Pythonupal block.


hook_block_configure() etc are only called in modules for blocks that that pareticular module defines in hook_block_info(), so if you're trying to hook into a block defined by another module you'll definitely have to user a form_alter function.

Just a note, hook implementations are cached in Drupal 7 so any time you declare a new hook you have to clear the caches before it'll get called.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜