I've tryied to add a new option in the toggle display fieldset in a Zen subtheme. With no success.
Maybe is an core issue, but anyway I should know if I can actually do it in the Zen's subtheme.
Firts: inspected the form array to see what would I put in the code and, wondered that the theme-settings.php should be the right place to make things. I successfully added a new option entry on the toggle display fieldset with the following:
$form['theme_settings']['toggle_myzensubtheme_sample'] = array(
'#type' => 'checkbox',
'#title' => t('Myzensubtheme sample'),
'#default_value' => theme_get_setting('toggle_myzensubtheme_sample'),
);Second: added a new info entry for the features:
features[] = myzensubtheme_sample
And finally, added the a wondered variable to be setted, following what I could see in the page.tpl.php:
<?php if ($myzensubtheme_sample): ?>
/* Do the cool things to be controlled through apperance interface */
<?php endif; ?>Not working. No idea what to do for the success.
Are I missing something? Or the features can't be controlled through custom theme (zen subtheme)? Should it be needed to create some kind of hook in other code's place?
Thanks in advance!
Comments
Comment #1
swati.karande commentedHi,
Can you please try this?
$form['theme_settings']['your_option'] = array(
'#type' => 'checkbox',
'#title' => t('Your Option'),
'#default_value' => theme_get_setting('your_option'),
);
['theme_settings'] is the existing fieldset to add your option to.
['your_option'] is the name of your new option.
.info file set :
settings[your_option] = 1
You can call this in from any of your .tpl.php files :
if (theme_get_setting('your_option')):endif;I hope it will help you.
Comment #2
danilocgsilva commentedThanks alot!!!!! Worked like a charm!
Comment #3
echoz commented