Hi,
i have created a new theme setting by adding followings codes to 'theme-settings.php' file in my omega subtheme. but by using 'alpha_get_theme()' function to get the theme container object for the current theme, the new saved setting doesn't placed in theme settings. can you point out what is the problem and is this the recommended way to access omega subtheme settings?

/**
 * Implements hook_form_system_theme_settings_alter()
 */
function glossy_form_system_theme_settings_alter(&$form, &$form_state) {
	
	$options = piecemaker_profile_options();
	
		$form['alpha_settings']['glossy_slideshow'] = array(
			'#type' => 'fieldset',
			'#weight' => -10,
			'#title' => t('Slideshow'),
		);
	
	if (!count($options)) {
		// Show alert message
		 $form['alpha_settings']['glossy_slideshow']['alert_ff_piecemaker_profile'] = array(
			'#type' => 'item',
			'#title' => t('From'),
			'#markup' => t('you must add at least one piecemaker profile'),
		);
	}else	{
		// Select piecemaker profle to use with front featured 3d slideshow
		 $form['alpha_settings']['glossy_slideshow']['ff_piecemaker_pid'] = array(
			'#type' => 'select',
			'#description' => t('Select the piecemaker profile that you want to use for front featured 3d slideshow.'),
			'#title' => t('Front Featured piecemaker profile'),
			'#default_value' => theme_get_setting('ff_piecemaker_pid'),
			'#options' => $options,
		);
	}
}

Comments

kardave’s picture

Version: 7.x-3.0-rc5 » 7.x-3.x-dev

This needs a place in the documentation. I found the solution but took several hours.
Although the custom setting gets saved, but you need to give your theme to the theme_get_setting() like this:

'#default_value' => theme_get_setting('ff_piecemaker_pid', 'glossy'),

I hope this help others too.

kardave’s picture

Issue summary: View changes

changing code wrapper

steinmb’s picture

Title: Omega Subtheme new settings are not saving. » Omega Subtheme new settings are not saving - Document correct use of theme_get_setting()
Component: Code » Documentation