Mukhbir

 
  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • green color
  • blue color

Add new custom menu type in joomla 1.5

E-mail Print PDF

To add new custom menu type in joomla 1.5 follow this tutorial:


goto> modules > mod_mainmenu

1. edit mod_mainmenu.xml:

<param name="menutype" type="mos_menu" default="" label="Menu Name" description="The name of the menu (default is mainmenu)" />
<param name="menu_style" type="list" default="list" label="Menu Style" description="The menu style">
<option value="list">List</option>
<option value="vert_indent">Legacy - Vertical</option>
<option value="horiz_flat">Legacy - Horizontal</option>
<option value="list_flat">Legacy - Flat List</option>
<option value="test_type">test-type</option>
</param>

2. edit: helper.php

function render(&$params, $callback)
{
switch ( $params->get( 'menu_style', 'list' ) )
{
case 'list_flat' :
// Include the legacy library file
require_once(dirname(__FILE__).DS.'legacy.php');
mosShowHFMenu($params, 1);
break;

case 'horiz_flat' :
// Include the legacy library file
require_once(dirname(__FILE__).DS.'legacy.php');
mosShowHFMenu($params, 0);
break;

case 'vert_indent' :
// Include the legacy library file
require_once(dirname(__FILE__).DS.'legacy.php');
mosShowVIMenu($params);
break;

case 'test_type' :
// Include the legacy library file
require_once(dirname(__FILE__).DS.'legacy.php');
mosShowttMenu($params, 0);
break;

3. goto legacy.php

copy the function for horizonatal type there e.g.

/**
* Draws a test style menu (very simple case)
*/
function mosShowttMenu(& $params, $style = 0)
{
$menu = & JSite::getMenu();
$user = & JFactory::getUser();

//get menu items
.
.

Comments (4)Add Comment
0
Vova
February 04, 2009
92.113.181.132
Votes: +0
...

Thank you! It really helps!

0
Mani
February 23, 2009
119.30.111.228
Votes: +1
...

How does this work?
Where will the menu appear?

0
Nabeel
February 25, 2009
119.153.22.137
Votes: +0
...

this one will show the menu type, in the module manager.

0
abdurrab
March 28, 2009
203.99.177.52
Votes: +0
...

thks a lot it helped me. n yes i didnt noticed first to change mosShowttMenu

Write comment
 
  smaller | bigger
 

busy
Last Updated ( Tuesday, 06 January 2009 19:48 )