Skip to content

Commit

Permalink
Interim 137 Subtheme wordmark support
Browse files Browse the repository at this point in the history
* Can now set wordmark via path in appearance setting within a subtheme

* Modified region--branding to make hide logo when subtheme settings demanded

* form--system-theme-settings.tpl.php modified to make Appearance page reflect subtheme logo
  • Loading branch information
jpilchisu authored and angelamnr committed Sep 20, 2017
1 parent 6444142 commit 61a3be6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions preprocess/preprocess-region.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function suitcase_interim_alpha_preprocess_region(&$vars) {
$vars['suitcase_interim_config_header_type'] = variable_get('suitcase_interim_config_header_type', 1);

// Get the uploaded wordmark if is exists and the header type allows
$vars['wordmark_image'] = (theme_get_setting('default_logo', 'suitcase_interim')) ? file_create_url(drupal_get_path('theme', 'suitcase_interim') . '/images/isu.svg') : file_create_url(theme_get_setting('logo_path', 'suitcase_interim'));
$vars['wordmark_image'] = (theme_get_setting('default_logo')) ? file_create_url(drupal_get_path('theme', 'suitcase_interim') . '/images/isu.svg') : file_create_url(theme_get_setting('logo_path'));

}
elseif ($vars['region'] == 'menu') {
Expand All @@ -60,4 +60,4 @@ function suitcase_interim_alpha_preprocess_region(&$vars) {
elseif (strpos($vars['region'], 'sidebar') === 0) {
$vars['attributes_array']['role'] = 'complementary';
}
}
}
2 changes: 1 addition & 1 deletion templates/form--system-theme-settings.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
?>
<div id="suitcase-interim-header-preview">
<?php $wordmark_path = (theme_get_setting('default_logo', 'suitcase_interim')) ? file_create_url(drupal_get_path('theme', 'suitcase_interim') . '/images/isu.svg') : file_create_url(theme_get_setting('logo_path', 'suitcase_interim')); ?>
<?php $wordmark_path = (theme_get_setting('default_logo', variable_get('theme_default'))) ? file_create_url(drupal_get_path('theme', 'suitcase_interim') . '/images/isu.svg') : file_create_url(theme_get_setting('logo_path', variable_get('theme_default'))); ?>
<div class="container-12 clearfix">
<div class="grid-6 suitcase-interim-vertical-tabs clearfix">
<ul class="suitcase-interim-vertical-tabs-list">
Expand Down
2 changes: 1 addition & 1 deletion templates/region--branding.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?php if ($site_name || $site_slogan): ?>

<?php if ($show_isu_nameplate): ?>
<?php if (theme_get_setting('default_logo', 'suitcase_interim')): ?>
<?php if (theme_get_setting('default_logo')): ?>
<a id="isu_header_wordmark" href="<?php print $level_1_url; ?>" title="Iowa State University Homepage"><img src="<?php print $wordmark_image; ?>" alt="Iowa State University"></a>
<?php else: ?>
<a id="isu_header_wordmark" href="<?php print $level_1_url; ?>" title="<?php print $site_name; ?>"><img src="<?php print $wordmark_image; ?>" alt="Iowa State University - <?php print $site_name; ?>"></a>
Expand Down
4 changes: 2 additions & 2 deletions theme-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function suitcase_interim_form_system_theme_settings_alter(&$form, &$form_state)
$form['suitcase_interim_config']['suitcase_interim_config_logo']['default_logo'] = array(
'#type' => 'checkbox',
'#title' => t('Use the default ISU wordmark'),
'#default_value' => theme_get_setting('default_logo', 'suitcase_interim'),
'#default_value' => theme_get_setting('default_logo'),
'#tree' => FALSE,
'#description' => t('Check here if you want to use the default ISU wordmark.')
);
Expand All @@ -67,7 +67,7 @@ function suitcase_interim_form_system_theme_settings_alter(&$form, &$form_state)
'#type' => 'textfield',
'#title' => t('Path to custom wordmark'),
'#description' => t('The path to the file you would like to use as your logo file instead of the ISU wordmark.'),
'#default_value' => theme_get_setting('logo_path', 'suitcase_interim'),
'#default_value' => theme_get_setting('logo_path'),
);

$form['suitcase_interim_config']['suitcase_interim_config_logo']['settings']['logo_upload'] = array(
Expand Down

0 comments on commit 61a3be6

Please sign in to comment.