Active
Project:
Omega
Version:
7.x-3.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Nov 2011 at 15:50 UTC
Updated:
12 Nov 2015 at 22:35 UTC
Jump to comment: Most recent
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
Comment #1
kardave commentedThis 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:
I hope this help others too.
Comment #1.0
kardave commentedchanging code wrapper
Comment #2
steinmb commented