[development] Custom Theme Settings

FGM fgm at osinet.fr
Fri May 11 07:27:15 UTC 2007


Funny how you created a "themesettings" module that duplicates my own
"themesettings" module..

http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/fgm/themesettings/

Is it the same mechanism/code ?

----- Original Message ----- 
From: "John" <drupal.user at albin.net>
To: <development at drupal.org>
Sent: Friday, May 11, 2007 8:57 AM
Subject: [development] Custom Theme Settings


> Custom theme settings are something that are currently possible, but
> don't work terribly well in PHPTemplate.
>
> Although it's not documented, you can add a phptemplate_settings()
> function to your theme's template.php and add custom settings. BUT,
> you can't edit settings of non-active themes because you would get
> function re-declaration errors if you were to try including both the
> active and non-active theme's template.php file. So a separate file
> is really needed to hold each theme's settings.
>
> I believe the best solution to this issue is to:
>
> 1. Change system_theme_settings() to allow both engine-specific
>     and theme-specific settings for any theme. Currently, if
>     the theme is based on an engine, system_theme_settings()
>     will only add engine-specific settings.
> 2. Add phptemplate_settings() to the PHPTemplate engine and,
>     using the $key passed by system_theme_settings(), look in
>     the $key theme's directory and include and return the
>     contents of a settings.php file.
>
> I've made a patch for Drupal 6.  If you want to review, contribute,
> (or commit :-D ), take a look at the issue, patch and example
> settings.php file here: http://drupal.org/node/57676
>
> - John (JohnAlbin)
>
>
> BTW, if you want a solution to this issue for Drupal 5, see my Theme
> Settings API module at http://drupal.org/project/themesettings
>
>



More information about the development mailing list