0

After update bootstrap module my theme doesn't work correctly. I use this code in my template.php (sub theme based on bootstrap).

function mytheme_preprocess_block(&$variables) {
  $block = $variables['block'];

  // Create css id attribute based on the block's administrative name
  if ($block->module == 'block') {
    $custom = block_custom_block_get($block->delta);
    $id = strtolower($custom['info']);
    $variables['block_html_id'] = $id;
  }
}

It was before I updated module

It was before I updated module

It's after

It's after

  • doesn't work is quite broad. What exactly doesn't work as expected? What difference do you see from before? Did you install also a new Drupal version? – kiamlaluno Apr 30 '17 at 9:18
0

First of all, bootstrap is a theme not module. You were using following code to above the main container(outside the image area as soon in your attachment):

function mytheme_preprocess_block(&$variables) {
  $block = $variables['block'];

  // Create css id attribute based on the block's administrative name
  if ($block->module == 'block') {
    $custom = block_custom_block_get($block->delta);
    $id = strtolower($custom['info']);
    $variables['block_html_id'] = $id;
  }
}

If you were using this code in bootstrap theme's template.php, instead of a child theme, than after updating the theme the custom code will be no more there as the old files are replaced by new updated files.

So you need to add your code in new template file updated.

| improve this answer | |
  • I use this code in my sub theme (template.php), which based on bootstrap. – NashGC May 1 '17 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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