[support] D7 Adding content to an empty region from template.php

Jeff Greenberg listmail.ayendesigns at gmail.com
Fri Jun 1 18:25:40 UTC 2012


I did try using that function, but two things, into which structure do you deposit the content, and if I display the region name, it seems this doesn't fire for the empty region.

Sent from my iPhone

On Jun 1, 2012, at 10:53 AM, Benj Fredrick <benj.fredrick at gmail.com> wrote:

> I don't know that it's the Right Way or the Best Way, but I have used template_preprocess_region() to add content to an empty region from template.php. 
> 
> hope that helps,
> -Benj
> 
> 
> On Thu, May 31, 2012 at 5:54 PM, Jeff Greenberg <listmail.ayendesigns at gmail.com> wrote:
> I was asking a slightly different question in the themes list, but I've narrowed down my issue, and believe it's more of a support question than a theme development question.
> 
> I am trying to add content to a region from within template.php. The region has no content prior to doing this.
> 
> I have tried drupal_add_region_content() from template_preprocess_page, template_preprocess_html and template_preprocess_region.
> 
> I've also tried just making an assignment to $vars[page][my_region][my_section_name][content][#markup] from the same functions.
> 
> Nothing results in output. Do I have to do it using hook_page_build from a module?
> 
> --
> [ Drupal support list | http://lists.drupal.org/ ]
> 
> -- 
> [ Drupal support list | http://lists.drupal.org/ ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20120601/e1c24edc/attachment.html 


More information about the support mailing list