Developer Blocks

Categories

Component ID

1296458

Component name

Developer Blocks

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Developer Blocks allows a developer to:

  • render a block programmatically
  • use theblock theme wrappers (the block divs)
  • use a renderable array for theming the block
  • pass arguments to the block theme

Developer Blocks is perfect when:

  • your module defines blocks with hook_block_info() and hook_block_view()
  • hook_block_view() returns a renderable array that uses the '#theme' key
  • hook_theme() uses a template and variables

With Developer Blocks, you can do this:

<?php echo devblocks_render('MODULE', 'BLOCK_DELTA', array(
  'arg1' => 'val1',
  'arg2' => 'val2',
  'arg3' => 'val3'
)) ?>

For the arguments to be passed to your theme/template, you must define the allowed variables in hook_theme().