[development] global object to push stuff into <head>

Ivan Sergio Borgonovo mail at webthatworks.it
Wed May 6 02:02:27 UTC 2009

On Tue, 5 May 2009 11:41:47 -0500
Jeff Eaton <jeff at viapositiva.net> wrote:

> On May 5, 2009, at 11:19 AM, Ivan Sergio Borgonovo wrote:
> > So there is no way to edit in a structured way head.
> In Drupal 7, I'd really love to see the globally alterable $page
> array become a place where this stuff lives. hook_page_alter
> already exists...

OK... the method to write there is getting simpler and simpler but
there is still just a drupal_get_html_head in D7 too.

I`d say is just a matter of giving a more fine grained structure to

Is there anything else worth to support other than:


rendering an arrays that represent the above shouldn`t be hard.

I think we can`t have a pure push or pull approach eg. for
Taxonomy may decide to fill description but the administrator may
like to have a description formed by node title + taxonomy terms or
node title and publishing date etc...

Anyway having a more structured HEAD may help both push and pull

eg. a module that doesn`t produce nodes but just "pages" may decide
to push some content in the META description. An "arbitrator" as
nodewords may decide to pull from nodes and taxonomies (views
etc...) some information, mix it in the description.
Another module may act just before page rendering and concatenate
some more stuff to what the "arbitrator" did.

eg. "Lamborghini Countach in Cars » Sport Cars, hot topic"
title + taxonomy + added by module

Anyway accessing a standard array may help modules interact better.

Somehow my "home-brewed" module already offers a global object which
store an array and offer some methods to deal with the most common
operations on keywords and description and then, at least for D5 I
added some code in the page template.
In D6 I could use prerender hook.

Ivan Sergio Borgonovo

More information about the development mailing list