User login

Ask Agaric: Settings for a Drupal theme without requiring a module

Hi,

I've been breaking my brain over some issue and I cant figure it out so I
figured I'd check with a fellow themer(s?)!

[Related d.o. thread: http://drupal.org/node/247032 ]

What I'm basically trying to do is use drupal theme settings in a file
that is not processed by drupal, and its part of a theme. I also do not
want to use any modules with it because I dont want the theme to be
dependent on a special module :)

Hello Jurriaan,

I've thought about this a lot myself. My current thoughts are that it doesn't seem too difficult (but I'd like to test the performance cost) to parse an .ini file.

The theme could then use the settings in the theme directory or conditionally override these settings from a specifically named file in the /files directory, if it exists. You would probably need a helper module if you want people to be able to edit this file through the user interface, but the theme wouldn't be dependent on this module and settings could be changed in the familiar somesetting = somevalue format.

Drupal 6 I understand makes more advanced theme settings possible without a module such as http://drupal.org/project/themesettingsapi -- but as the best-maintained community module, that's not a bad "optional requirement" for your theme either-- simply provide sensible defaults if ThemeSettingsAPI isn't present.

I can locate my notes on parsing .ini files if you're interested.

Good timing on writing in! I like your theme work and I need to put up a site quickly, so I think I'll use one... Agaric co-founder Dan Hakimzadeh is the expert themer, but I consult on questions about this gray area between modules and themes.

(Please note that we post questions and our answers to AgaricDesign.com to share any knowledge people may glean from them. Let us know if there's information you would like excluded.)

benjamin

Agaric Design Collective
Open Source Free Software Web Development
http://agaricdesign.com/

Resolution

Searched words: 
theme config without bloat theming to provide user-configurable settings administration options for Drupal theme do not require module

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.