Example #1
0
function storvargen_preprocess_block(&$vars)
{
    if ($vars['block']->module == 'block') {
        $info = block_custom_block_get($vars['block']->delta);
        $description = seoUrl($info['info']);
        $vars['classes_array'][] = $description;
    }
}
/**
 * Implements hook_preprocess_block().
 *
 * @see block.tpl.php
 */
function bootstrap_agency_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;
    }
}
Example #3
0
 /**
  * Change block definition before saving to the database
  * 
  * @param array  &$blocks    A multidimensional array of blocks keyed by the defining module and delta
  * @param string $theme      The theme these blocks belong to
  * @param array  $codeBlocks The blocks as defined in hook_block_info()
  *  
  * @return void
  */
 public function alterBlockInfo(array &$blocks, $theme, array $codeBlocks)
 {
     if (isset($blocks['block']) && is_array($blocks['block'])) {
         foreach ($blocks['block'] as $delta => $data) {
             $settings = block_custom_block_get($delta);
             if (!empty($settings['lc_class'])) {
                 $blocks['block'][$delta]['cache'] = DRUPAL_NO_CACHE;
             }
         }
     }
 }