1
votes

In Drupal 6, it was so easy to print content to an existing region using the following:

<?php
  drupal_set_content('left-sidebar', $field_MY_FIELD_rendered);
?>

I've been searching and searching for how to do this in Drupal 7 after finding out drupal_add_region_content() doesn't work and I'm at a loss.

I can get the exact output I'm looking for using $output = render($content['field_MY_FIELD']);, but I see no way to output that to a block without having to write a hook in a separate module or some such thing.

Any ideas on how to output $output to a region using node--type.tpl.php?

Thanks in advance,

Dan

1
drupal_add_region_content() works fine (core itself uses the function to assign page content to the necessary regions). Where are you calling it from? - Clive
@Clive, thanks but I think it only works for core (see drupal.org/node/713462). I'm calling it from node--type.tpl.php. - Webdrips

1 Answers

0
votes

Have you tried putting field--field_myfield.tpl.php in your templates directory?