In my custom theme I am developing, I have a form API setting in
theme-settings.php that lets a user choose one of two options with a select menu as such:
$form['txtr_settings']['general_settings']['choose_slideshow'] = array( '#type' => 'select', '#title' => t('Choose a slideshow'), '#default_value' => theme_get_setting('choose_slideshow'), '#options' => array( 'basic' => t('Basic'), 'fancy' => t('Fancy'), ), );
Then in my theme's
page.tpl.php I want the value the user has selected to be part of an if else statement.
Right now I have this code which does not seem to work:
<?php if (theme_get_setting('choose_slideshow') == 'basic') include(dirname(__FILE__) . "/slideshow_alpha.inc"); else include(dirname(__FILE__) . "/slideshow_beta.inc"); ?>
I know if I have a simple single checkbox (checked = yes or '1' I can do something like this:
<?php if (theme_get_setting('choose_slideshow') == 1)
... but in this case I really want to show the user both options and have them choose one or the other in the select menu.
If I use either option on it's own without the if / else, each works fine so I think it's a question of my
theme_get_setting value. I am not really sure if this is a Drupal question or a PHP question that I should ask over on Stack Exchange.