I’ve got problem with making main-menu wrapped in element. I’ve tried:
-
Using hooks in template.php like:
function koko_menu_link_main_menu($variables) { /* For block override */ $output = '<nav>'; foreach ($variables['links'] as $link) { $output .= l($link['title'], $link['href'], $link); } $output .= '</nav>'; return $output; } function koko_links__system_main_menu($variables) { $output = '<nav>'; foreach ($variables['links'] as $link) { $output .= l($link['title'], $link['href'], $link); } $output .= '</nav>'; return $output; }
Using preprocesss/block.preprocess.inc:
switch ($variables['block']->module) { case 'system': switch ($variables['block']->delta) { case 'help': case 'powered-by': break; case 'main': // Use a template with no wrapper for the page's main content. $variables['theme_hook_suggestions'][] = 'block__minimal'; break; default: // Any other "system" block is a menu block and should use // block--nav.tpl.php $variables['theme_hook_suggestions'][] = 'block__nav'; break; } break; case 'menu': case 'menu_block': // Use block--nav.tpl.php template. $variables['theme_hook_suggestions'][] = 'block__nav'; break; } case 'main': // Use a template with no wrapper for the page's main content. $variables['theme_hook_suggestions'][] = 'block__minimal'; break; default: // Any other "system" block is a menu block and should use // block--nav.tpl.php $variables['theme_hook_suggestions'][] = 'block__nav'; break; } break; case 'menu': case 'menu_block': // Use block--nav.tpl.php template. $variables['theme_hook_suggestions'][] = 'block__nav'; break; }
That contains. block–nav.tpl.php
<nav<?php print $attributes; ?>> <?php print render($title_prefix); ?> <?php print render($title_suffix); ?> <?php print $content; ?> </nav>
Still nothing happends. Main-menu is not wrapped in anything different than: <div class="content">
.