I am trying to change the <h2>
tags that block.tpl.php
uses to wrap <?php print $block->subject ?>
to <h3>
tags so that I can target them with jQuery UI Accordion. I've got the following code:
<?php
function MYTHEME_block_view_alter(&$data, $block) {
if($block->module == 'block' && $block->region == 'sidebar') {
$data['subject']['#tag'] = 'h3';
}
}
?>
This doesn't work...I assume I'm screwing up the reference to the render element. Does $data['subject']
contain an array where the HTML tag is stored? What is the correct way to target it?
Alternatively, should I look for a way to re-write block markup so that, in the sidebar
region, it renders only the <h3>
and <div>
required by jQuery UI Accordion? Unless there's a fantastic module for turning blocks into Accordion-ready HTML already out there, I'd rather not install another module.
Many thanks for any help!