summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnAlbin2011-04-25 17:59:26 (GMT)
committer JohnAlbin2011-04-25 17:59:26 (GMT)
commitffb5438ed28092fe527cf29e09975a153d710ef3 (patch)
treec3449417b359d43a08d7d7f670911a78b8b09243
parent74cf7b6139d1289dbd481aa206594620f4bb23ba (diff)
Issue #812480 by Garrett Albright and JohnAlbin: Make "Jump to Nav" link configurable
-rw-r--r--CHANGELOG.txt1
-rw-r--r--STARTERKIT/STARTERKIT.info.txt1
-rw-r--r--template.php1
-rw-r--r--templates/html.tpl.php4
-rw-r--r--theme-settings.php7
-rw-r--r--zen.info1
6 files changed, 14 insertions, 1 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index b913537..7e3bbbe 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,5 +1,6 @@
Zen 7.x-3.x-dev, xxxx-xx-xx (development release)
---------------------------
+- #812480 by Garrett Albright and JohnAlbin: Make "Jump to Nav" link configurable
- #1135120: PHP notice about undefined $highlight variable on maintenance-page.tpl
- #705264 by grendzy: Allow Zen (and subthemes) to be used without a database
- #774838: Add view_mode class to node.tpl
diff --git a/STARTERKIT/STARTERKIT.info.txt b/STARTERKIT/STARTERKIT.info.txt
index e2cdecc..57ddd35 100644
--- a/STARTERKIT/STARTERKIT.info.txt
+++ b/STARTERKIT/STARTERKIT.info.txt
@@ -118,6 +118,7 @@ settings[zen_breadcrumb_separator] = ' › '
settings[zen_breadcrumb_home] = 1
settings[zen_breadcrumb_trailing] = 1
settings[zen_breadcrumb_title] = 0
+settings[zen_jump_link_target] = main-menu
settings[zen_rebuild_registry] = 1
settings[zen_wireframes] = 0
diff --git a/template.php b/template.php
index 6bb40ef..6b51ab8 100644
--- a/template.php
+++ b/template.php
@@ -210,6 +210,7 @@ function zen_preprocess_html(&$variables, $hook) {
$variables['classes_array'][] = 'page-panels';
break;
}
+ $variables['jump_link_target'] = theme_get_setting('zen_jump_link_target');
}
/**
diff --git a/templates/html.tpl.php b/templates/html.tpl.php
index 75b1191..2f04b89 100644
--- a/templates/html.tpl.php
+++ b/templates/html.tpl.php
@@ -25,6 +25,8 @@
* - $styles: Style tags necessary to import all CSS files for the page.
* - $scripts: Script tags necessary to load the JavaScript files and settings
* for the page.
+ * - $jump_link_target: The HTML ID of the element that the "Jump to Navigation"
+ * link should jump to. Defaults to "main-menu".
* - $page_top: Initial markup from any modules that have altered the
* page. This variable should always be output first, before all other dynamic
* content.
@@ -69,7 +71,7 @@
</head>
<body class="<?php print $classes; ?>" <?php print $attributes;?>>
<div id="skip-link">
- <a href="#main-menu" class="element-invisible element-focusable"><?php print t('Jump to Navigation'); ?></a>
+ <a href="#<?php print $jump_link_target; ?>" class="element-invisible element-focusable"><?php print t('Jump to Navigation'); ?></a>
</div>
<?php print $page_top; ?>
<?php print $page; ?>
diff --git a/theme-settings.php b/theme-settings.php
index 2659a68..98d0371 100644
--- a/theme-settings.php
+++ b/theme-settings.php
@@ -86,6 +86,13 @@ function zen_form_system_theme_settings_alter(&$form, $form_state) {
),
'#default_value' => theme_get_setting('zen_layout'),
);
+ $form['themedev']['zen_jump_link_target'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Anchor ID for “Jump to Navigation” link'),
+ '#default_value' => theme_get_setting('zen_jump_link_target'),
+ '#field_prefix' => '#',
+ '#description' => t('Specify the HTML ID of the main navigation menu; this will be used by the accessible-but-hidden “Jump to Navigation" link at the top of each page.'),
+ );
$form['themedev']['zen_wireframes'] = array(
'#type' => 'checkbox',
'#title' => t('Add wireframes around main layout elements'),
diff --git a/zen.info b/zen.info
index d50f7c7..4aa45c6 100644
--- a/zen.info
+++ b/zen.info
@@ -23,5 +23,6 @@ settings[zen_breadcrumb_home] = 1
settings[zen_breadcrumb_trailing] = 1
settings[zen_breadcrumb_title] = 0
settings[zen_layout] = zen-columns-liquid
+settings[zen_jump_link_target] = main-menu
settings[zen_rebuild_registry] = 0
settings[zen_wireframes] = 0