Skip to content
Snippets Groups Projects
Commit f5eb7f28 authored by Tim Steiner's avatar Tim Steiner
Browse files

Add support for intermediate breadcrumbs in the template.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@116 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 74a6479c
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ $t->head .= PHP_EOL
. $head . PHP_EOL
. $styles . PHP_EOL
. $scripts . PHP_EOL
. '<link href="' . url('<front>', array('absolute' => TRUE)) . '" rel="home" />' . PHP_EOL
;
if (theme_get_setting('use_base')) {
......
......@@ -21,18 +21,28 @@ function unl_wdn_breadcrumb($variables)
$breadcrumbs = $variables['breadcrumb'];
if (count($breadcrumbs) == 0) {
$breadcrumbs[] = unl_get_site_name_abbreviated();
$breadcrumbs[] = '<a href="">' . unl_get_site_name_abbreviated() . '</a>';
} else {
//Change 'Home' to be $site_name
array_unshift($breadcrumbs,
str_replace('Home', unl_get_site_name_abbreviated(),
array_shift($breadcrumbs)));
}
//Add the intermediate breadcrumb if it exists
$intermediateBreadcrumbText = theme_get_setting('intermediate_breadcrumb_text');
$intermediateBreadcrumbHref = theme_get_setting('intermediate_breadcrumb_href');
if ($intermediateBreadcrumbText && $intermediateBreadcrumbHref) {
array_unshift($breadcrumbs, '<a href="' . $intermediateBreadcrumbHref . '">' . $intermediateBreadcrumbText . '</a>');
}
//Prepend UNL
array_unshift($breadcrumbs, '<a href="http://www.unl.edu/">UNL</a>');
//Append title of current page -- http://drupal.org/node/133242
if (!drupal_is_front_page()) {
$breadcrumbs[] = drupal_get_title();
}
$html = '<ul>' . PHP_EOL;
foreach ($breadcrumbs as $breadcrumb) {
......
......@@ -2,24 +2,53 @@
function unl_wdn_form_system_theme_settings_alter(&$form, &$form_state)
{
$form['site_name_abbreviation'] = array(
'#type' => 'textfield',
$form[] = array(
'#type' => 'fieldset',
'#title' => t('Site Name Abbreviation'),
'site_name_abbreviation' => array(
'#type' => 'textfield',
'#default_value' => theme_get_setting('site_name_abbreviation'),
'#description' => t('An abbreviated version of your site\'s name to use in breadcrumbs.')
)
);
$form['zen_forms'] = array(
$form['intermediate_breadcrumb'] = array(
'#type' => 'fieldset',
'#title' => t('Intermediate Breadcrumb'),
'#description' => t('A breadcrumb that is displayed between the UNL breadcrumb and this site\'s breadcrumb'),
'intermediate_breadcrumb_text' => array(
'#type' => 'textfield',
'#title' => t('Text'),
'#default_value' => theme_get_setting('intermediate_breadcrumb_text'),
'#description' => t('An abbreviated version of your site\'s name to use in breadcrumbs.')
),
'intermediate_breadcrumb_href' => array(
'#type' => 'textfield',
'#title' => t('URL'),
'#default_value' => theme_get_setting('intermediate_breadcrumb_href'),
'#description' => t('An abbreviated version of your site\'s name to use in breadcrumbs.')
)
);
$form['advanced_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Advanced Settings'),
'zen_forms' => array(
'#type' => 'checkbox',
'#title' => t('Use Zen Forms'),
'#default_value' => theme_get_setting('zen_forms'),
'#description' => t('Transforms all forms into the list-based zen forms.')
);
),
$form['use_base'] = array(
'use_base' => array(
'#type' => 'checkbox',
'#title' => t('Use HTML Base Tag in Head'),
'#default_value' => theme_get_setting('use_base'),
'#description' => t('Adds an HTML Base tag to the &lt;head&gt; section with href="' . url('<front>', array('absolute' => TRUE)) . '"')
)
);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment