I am adding theme styling settings and I would like to have associated color to the checkbox in themes setting form. So far, i haven’t been able to do so, because the output strips inline styling and then external styling is being reset for the admin view. How do you enable html output of the text next to the checkbox?
Here is my code so far:
function THEMENAME_form_system_theme_settings_alter(&$form, &$form_state){ $form['theme_style'] = array( '#title' => 'Theme Style', '#type' => 'fieldset', '#collapsible' => FALSE, '#collapsed' => FALSE, ); $form['theme_style']['color'] = array( '#title' => t('Color Skin'), '#type' => 'checkboxes', '#options' => color_schemas(), // '#process' => array(), '#pre_render' => array(), '#post_render' => array(), '#format' => array('text_format' => 'full_html'), ); } function color_schemas(){ $colors = array( 'blue' => htmlentities('<span style="display:inline-block;width:20px;height:20px;background-color:#DDD;vertical-align:middle;border-radius:0">Blue</span>'), 'black' => '<span id="black-skin">Black</span>', 'maroon' => t('Maroon'), 'grey' => t('Grey'), 'white' => t('White'), ); return $colors; }
Here i try different things. To set the text format in ‘#format’ attribute. I also attach ‘id’ element so could style in external style sheet but those are reset by admin imported CSS. I also try convert all html entities and output which works but it doesn’t render the html correctly