[development] alter theme registry, but only for some themes. possible?

John Wilkins drupal.user at albin.net
Thu Dec 3 15:36:33 UTC 2009

If the user edits a theme's .info file, they need to visit admin/build/themes before Drupal will rebuild its .info file cache.

If the user has to submit a form, you would just need to add drupal_rebuild_theme_registry() to the form's submit handler.

Also, Zen 6.x-2.x has theme_process_hook functions (which come after the preprocess ones). And there's no reason a module couldn't add some using hook_theme_registry_alter().

 - John

On Dec 1, 2009, at 8:08 AM, David Cohen wrote:

> I have some modules that alter the theme registry.  In practice, I could
> limit these alterations to only some themes.  On a site with multiple
> themes, my modules might need to alter only one or two.  However, I
> can't figure a way in code to determine which themes might need these
> alterations.
> Ideally, I could allow the administrator to select one or more themes
> which will be used.  Either by selecting the themes in a form, or
> possibly by adding something to the theme's .info file.
> Is such a thing possible.  In particular, how can I ensure that the
> theme registry will be rebuilt after the administrator submits my form
> or edits the .info file?  Is there a best practice along these lines?
> -Dave
> P.S. too bad drupal doesn't support post-process functions in theme...

More information about the development mailing list