0
votes

Goal:

  • I want to create a block.
  • I want the block to have a tpl file.
  • I want to pass an array to the tpl for easy "I dont know php" editing.

In the tpl I want to:

print render($content['something']);

... instead of just print (render) the entire content all at once:

print $content;


Approach so far:

  • Implement hook_block_info.
  • Implement hook_block_view and set $block['content'] to a function which returns a renderable array.
  • Create the right block_ .tpl file and print $content['something'].
  • Error :(

Now, I can make this work by implementing hook_theme, but I would love to just use the default block_ .tpl. Am I doing something wrong?

1

1 Answers

0
votes

In the .tpl you can do:

print render($elements['something']);

wee!