Okay, so here's another crazy idea: conditional theme options, i.e. in plain text "if theme option A is value X, enable theme option B".
Example use: I might include a theme option to use either a fixed or fluid width layout. Now, if the user opts for the fluid layout, it makes sense to use a max-width for the main container, which doesn't make much sense if the layout has fixed width. It also makes perfect sense to let the user choose a max-width, i.e. if he selects the fluid width, the template could display a set of radio buttons to choose between a max-width of, say, 1024px, 1280px or 1600px.
This would also help to keep the theme options page tidy if template authors offer a lot of theme options. Maybe this concept could also be used for plugin configuration?
YL
[1.6] Conditional theme options
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: [1.6] Conditional theme options
Hi!
You can already do that in the config.inc.php, just like you do "conditional navigation items" depending on the # that the user previously inputted. You can check for any current variable setting and add/remove options depending on that.
Same applies for plugins, several plugins already show options only if specific options are set...
Regards,
Garvin
You can already do that in the config.inc.php, just like you do "conditional navigation items" depending on the # that the user previously inputted. You can check for any current variable setting and add/remove options depending on that.
Same applies for plugins, several plugins already show options only if specific options are set...
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: [1.6] Conditional theme options
Do we have conditional plugin options? I could use them.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: [1.6] Conditional theme options
Yes, in introspect_config_item() you can use any PHP code, also to check with $this->get_config() if a depending config option is set to a specific value. serendipity_plugin_linklist uses this, i.e.onli wrote:Do we have conditional plugin options? I could use them.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/