HTML within menu links

I am new to Drupal and am porting a Joomla site to D7, whereby the Joomla site has multi-line menu items with the second line italiziced. I am using Views for my pages and have created the main navigation menu using Admin/Structure/Menus/Main Menu.

The html in the Joomla site looks like this:

<div id="main-menu">
<ul>
<li class="level1 item1 active current">
<a href="/page-1">
<span class="title">Menu Item Title</span>
<span class="subtitle">Menu Item Subtitle</span>
</a></li></ul></div>

The pertinent css for breaking the line and italicizing:

#main-menu  span.subtitle {
	font-style: italic;
	display: block;
}

I've researched many posts and many approaches for wrapping menu items in span tags and modifying menu item attributes. However, I have only found one approach for allowing inline html in menu items. It entails adding this code to template.php:

function MYTHEME_menu_link__MENUNAME($variables)
{
$element = $variables['element'];
$sub_menu = '';

if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
}

// Enable this to use html in title, eg img, span or something else...
$element['#localized_options']['html'] = true;

$link = l('' . $element['#title'] . '', $element['#href'], $element['#localized_options']);

Menu in Drupal

Hello,

I must create a template like this http://www.tvh.com/landingpage/ based on the drupal 7. I don't have experience with drupal... Can anybody tell my the best solution for the menu, is easy to use coordinations for my menu in drupal? Thanks!

Drupal as the best CMS

Hello,

I am using Drupal for long time. I have tested other Content Management Systems like Joomla, PHP-Fusion...

Joomla is good, but it requires good knowledge about that script, for example it's complicated when you want add page in Joomla. It's not organized for me.

PHP-Fusion lightweight script for small website, can't be extended to better functionality without knowledge about PHP, MySQL... You can't do much with that script.

Error with Forum

Hi,
I am new to Drupal and found it superb! After installing it on a shared server, I am having an error with the forum. Please visit this link to see what the error is actually and how to get around it. Everything is green on my site's status report.
Thanks

Colour coded areas

Hi

hook.views.inc file not picked up

1. Have the following code in mymodule.module file.

 function mymodule_views_api() { 
  return array(
    'api' => 3,
      );
}

The mymodule.views.inc file is in the module directory. And it contains the following code:

function mymodule_views_query_alter(&$view, &$query) {
	 if($view->name == 'interview_question_options_block'){
	 echo ('Got here');
	 dpm($view);
		
		}
	}

But neither the echo nor dpm is giving any output.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x