I am attempting to edit the output joomla primary_menu module in order to create a custom dropdown menu. Right now it presently results html such as this:

<ul class="menu">

<li class="active item1" id="current"><a href="#"><span>First Level Item </span</a></li>

<li class="parent item63"><a href="#"><span>First Level Item Parent</span></a>


  <li class="item60"><a href="#"><span>Second Level Item</span></a></li>

  <li class="item69"><a href="#"><span>Second Level Item</span></a></li>



<li class="item64"><a href="#"><span>First Level Item</span></a></li>

<li class="item66"><a href="#"><span>First Level Item</span></a></li>

What I must do is take away the span tags for that output.

Things I know to date is when I wish to edit the output during my template folder I create a directory known as 'html' after which within that a brand new directory known as 'mod___mainmenu' after which a make copy the default.php file in the existing mod_mainmenu folder in the modules directory. All the new changes to I make to consider file can change the output.

The issue that I am getting is the fact that I can not know very well what is going on using the code that's designed in the default.php file because it apply certain XML system that I am unfamilar with and you will find no comments.

If anybody has any ideas that might be super useful!

This is actually the code in the default.php apply for recption menus:

defined('_JEXEC') or die('Restricted access')

if ( ! defined('modMainMenuXMLCallbackDefined') )

amplifier$node, $args)

amplifier&lifier ($node->attributes('level') >= $args['end']))

if ($node->name() == 'ul') 

if (($node->name() == 'li') &lifier&lifier isset($node->ul)) 

if (isset($path) &lifier&lifier in_array($node->attributes('id'), $path))



amplifier&lifier !$args['children'])

if (($node->name() == 'li') &lifier&lifier ($id = $node->attributes('id')))  else 

if (isset($path) &lifier&lifier $node->attributes('id') == $path[])  else 



define('modMainMenuXMLCallbackDefined', true)

modMainMenuHelper::render($params, 'modMainMenuXMLCallback')

You need to avoid editing core files whenever you can to prevent getting your changes overwritten whenever you upgrade. Use template override files rather.

After I went into this, I added and empty em tag to every food selection to permit Gilder/Levin image alternative. During my html override (htmlmod_mainmenudefault.php) I encircled the phone call to modMainMenuHelper::render (the final line, essentially) by having an output buffer, and used an easy str_replace to include the em tag:


modMainMenuHelper::render($params, 'modMainMenuXMLCallback')

$mainMenuContent = doctor_get_clean()

echo str_replace('</span>', '</span><em></em>', $mainMenuContent)

Since you want to eliminate the span tag, you could do this:


modMainMenuHelper::render($params, 'modMainMenuXMLCallback')

$mainMenuContent = doctor_get_clean()

echo str_replace(array('<span>','</span>'), array('',''), $mainMenuContent)