summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt1
-rw-r--r--template.php3
-rw-r--r--templates/block.tpl.php3
3 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 6c1032f..8dcf03b 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -2,6 +2,7 @@
Zen 6.x-2.x-dev, xxxx-xx-xx (development release)
------------------------
+- Added $block_html_id to block.tpl.php.
- #772488 by andreiashu: Fatal error: Call to undefined function ctools_menu_primary_local_tasks()
- #707410 by agentrickard and JohnAlbin: Add page-views and page-panels body classes
- #691426: Add D7-style named implementations of theme_links in page.tpl
diff --git a/template.php b/template.php
index 6dfeee1..41a8ca3 100644
--- a/template.php
+++ b/template.php
@@ -534,6 +534,9 @@ function zen_preprocess_block(&$vars, $hook) {
$vars['classes_array'][] = 'region-count-' . $vars['block_id'];
$vars['classes_array'][] = 'count-' . $vars['id'];
+ // Create the block ID.
+ $vars['block_html_id'] = 'block-' . $block->module . '-' . $block->delta;
+
$vars['edit_links_array'] = array();
if (theme_get_setting('zen_block_editing') && user_access('administer blocks')) {
include_once './' . _zen_path() . '/zen-internals/template.block-editing.inc';
diff --git a/templates/block.tpl.php b/templates/block.tpl.php
index a45ca7f..e7b5c14 100644
--- a/templates/block.tpl.php
+++ b/templates/block.tpl.php
@@ -44,6 +44,7 @@
* - $is_front: Flags true when presented in the front page.
* - $logged_in: Flags true when the current user is a logged-in member.
* - $is_admin: Flags true when the current user is an administrator.
+ * - $block_html_id: A valid HTML ID and guaranteed unique.
*
* @see template_preprocess()
* @see zen_preprocess()
@@ -52,7 +53,7 @@
* @see zen_process()
*/
?>
-<div id="block-<?php print $block->module . '-' . $block->delta; ?>" class="<?php print $classes; ?>">
+<div id="<?php print $block_html_id; ?>" class="<?php print $classes; ?>">
<?php if ($title): ?>
<h2 class="title"><?php print $title; ?></h2>
<?php endif; ?>