Currently I am working on a site where I need groups of blocks which should be collapsible. The blocks are grouped by using block group module. For the collapsible part I am using collapsiblock. By default the block group is rendered in a simple div, which I change by applying a template to add the title. But the title is not available as a variable, because block group module uses the title field only for administration and thus the $title variables are all empty.

Does anybody know how to access the variable in a template file?

1 Answer 1


I'm about to do something similar, but I imagine you could do a preprocess and populate the variable yourself.

-- EDIT --

As a matter of fact, I am sure of it. Just did it myself.

In template.php write a hook_preprocess_region() function.

function mytheme_preprocess_region(&$variables) {
  if ($variables['region'] == 'blockgroup_regionname') {
    $variables['title'] = 'Title';

Then just in your template.

<?php if ($title): ?>
  <h2 class="title"><?php print $title; ?></h2>
<?php endif; ?>

Which in turn should make the variable available to whatever else you are trying to do. SHOULD anyway. Good luck!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.