Skip to content

Instantly share code, notes, and snippets.

@laurelstreng
Last active September 22, 2016 14:42
Show Gist options
  • Save laurelstreng/ee27cc336a5590d5d16182a6fd8ec5dd to your computer and use it in GitHub Desktop.
Save laurelstreng/ee27cc336a5590d5d16182a6fd8ec5dd to your computer and use it in GitHub Desktop.
Drupal 7 - Theme Settings WYSIWYG Field
<?php if (theme_get_setting('features_title')): ?>
<div class="features-title">
<?php $featurestitle = theme_get_setting('features_title'); ?>
<?php print check_markup($featurestitle['value'], $featurestitle['format']); ?>
</div>
<?php endif; ?>
function THEMENAME_form_system_theme_settings_alter(&$form, $form_state, $form_id = NULL){
if (isset($form_id)) {
return;
}
$form['front_page'] = array(
'#type' => 'fieldset',
'#title' => t('Front Page'),
'#description' => t('Add/edit titles for each unique section of the Front Page.'),
);
$featurestitle = theme_get_setting('features_title');
$form['front_page']['features_title'] = array(
'#type' => 'text_format',
'#title' => t('Features Title'),
'#default_value' => $featurestitle['value'],
'#format' => 'full_html',
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment