0

I want to integrate a CSS switcher into my theme, but without the Color module. So I want a radio button list, (or a select list, or dropdown, doesn't really matter), with a list of different styles, and then I also wanted a 'Custom' option, so that the user could input a hex code instead of picking a style.

I know how to create a radio list, but how can I add a 'custom' text field too? Any ideas?

And then... what would go in page.tpl.php if the user has selected 'custom'?

  • So you have a list of radio buttons and then you want to show a text field only if the user selects the option 'custom' instead of a predefined option, right? If the answer is yes, you would want to use the States API with the FAPI that you are using to build out the theme settings form. Check out the Drupal Examples module and you will see form examples in the modules, look for the States API part and there are examples of this. drupal.org/project/examples – burnsjeremy Mar 14 '15 at 12:31
0

I think the select_or_other module is what you are looking for. it let's you create a select box or checkboxes with textfield as last option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.