I’ve obtained downside with making main-menu wrapped in factor. I’ve tried:
-
Utilizing hooks in template.php like:
operate koko_menu_link_main_menu($variables) { /* For block override */ $output = '<nav>'; foreach ($variables['links'] as $hyperlink) { $output .= l($hyperlink['title'], $hyperlink['href'], $hyperlink); } $output .= '</nav>'; return $output; } operate koko_links__system_main_menu($variables) { $output = '<nav>'; foreach ($variables['links'] as $hyperlink) { $output .= l($hyperlink['title'], $hyperlink['href'], $hyperlink); } $output .= '</nav>'; return $output; }
Utilizing preprocesss/block.preprocess.inc:
swap ($variables['block']->module) { case 'system': swap ($variables['block']->delta) { case 'assist': case 'powered-by': break; case 'predominant': // Use a template with no wrapper for Drupal Developer web page's predominant content material. $variables['theme_hook_suggestions'][] = 'block__minimal'; break; default: // Some other "system" block is a menu block and may 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 'predominant': // Use a template with no wrapper for Drupal Developer web page's predominant content material. $variables['theme_hook_suggestions'][] = 'block__minimal'; break; default: // Some other "system" block is a menu block and may 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 incorporates. block–nav.tpl.php
<nav<?php print $attributes; ?>> <?php print render($title_prefix); ?> <?php print render($title_suffix); ?> <?php print $content material; ?> </nav>
Nonetheless nothing happends. Primary-menu will not be wrapped in something completely different than: <div class="content material">
.