Thanks for the great work!!!
i am trying to output the main menu as "Simple navbar" at the top but i can't.
Now the output is the default "inset list"

My page is http://peoplenews.me/search-mobile

Many thanks

Comments

jasonsavino’s picture

Assigned: Unassigned » jasonsavino
Status: Active » Closed (fixed)

Basically you need override the link function for the system main menu.

You would need to modify two files in the theme.
First, modify the includes/modules/theme.inc file and add this function:

<?php
function mobile_jquery_links__system_main_menu($vars) {
	$links = $vars['links'];
	$output = '<div data-role="navbar"><ul ' . drupal_attributes($vars['attributes']) . '>';
	
	foreach($links as $link => $value) {
		$output .= l($links[$link]['title'], $links[$link]['href'], array('html' => TRUE));
	}
	
	$output .= '</ul></div>';
		
	return $output;
}
?>

Next, modify page.tpl.php by add the following in the header section (div class="header" ... )

<?php if ($main_menu): ?><?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix')))); ?><?php endif; ?>

and remove the following from the navigation section (div class="navigation" ...)

<?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => t(''))); ?>
egarias’s picture

Many Thanks!!!!!!
it works
i placed function mobile_jquery_links__system_main_menu($vars) in the template.php

ionmedia’s picture

how to add corners to this menu ?