php - How do I change the output of drupal 7 menu blocks in one specific region? -


so have several menu blocks in region 1 drupal 7 site. need wrap each of these menu blocks in <section> tag, leave other menu blocks unaffected. thinking preprocess region, check if blocks menu blocks, , can see, attempt wrap output in section tag. can please tell me i'm doing wrong? problem killing me.

function mytheme_preprocess_region(&$vars){     //checks see if we're in correct region     if($vars['region'] == "footer-top"){             //loops through every block in our region             foreach($vars['elements'] $key => $item){                     $block_type = $item['#block']->module;                     //if it's menu block, wrap output in section tag, doesnt work                     if($block_type == "menu_block"){                             //$vars['elements']['menu_block_4']['#children'] = "<section>" . $item['#children'] . "</section>";                             $vars['elements'][$key]['#children'] = "<section>" . $item['#children'] . "</section>";                     }             }     } } 

look block templating. base block template in modules/block/block.tpl.php. can override base template specific block.

basically need create new block template file in theme folder.

https://drupal.org/node/1089656


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -