Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • jaway Friend
    #133031

    Could somebody suggest an extension that would make it possible to create a configurable combobox menu such as that found on this site:

    or even better,

    • the one at the bottom right corner of this Joomlart forum?

    I would like to be able to display The 1st level menu, 2nd level and potentially configure it to show fewer or more details.

    Thanks


    1. 2008-09-06_165448
    tonyg Friend
    #269217
    jaway Friend
    #269884

    Thanks tonyg,

    This is quite a complex extension. I am not sure you understood what I want to do – did you have a look at the attachment in my first post to the thread? I want a drop down list, similar to a drop down of countries in a form address field. I want in this drop down to list all my Main Menu options like this

    Level 0
    – Level 1
    –Level 2

    or

    Level 0
    Level 1
    Level 2

    Can you or anybody else suggest a suitable and simple way of doing that?

    The two I found on Joomla’s Extension page:

    1. Quick Jump Menu
    2. X-Quick Jump

    Unfortunately these have serious problems
    a) they do not handle top level of the menu structure i.e. Level 0 from above example
    b) one of them sorts everything alphabetically and doesn’t remove duplicates
    c) there is no control over what appears and doesn’t appear.

    I am sure that there must be a simple way to create a simple links dropdown like the 2 examples I gave in my original post. I thought that since Joomlart has such a dropdown in its forum somebody from the admins/moderators/developers could tell us how they did it or how they suggest to do it

    Tonyg, just in case I have misunderstood your suggestion:
    Q1) Do you have an example of a similar combo box menu that has been created using this extension?
    Q2) Do you have a link to any instructions on how to do that?

    maclarkson Friend
    #288745

    With a modifcation of the Quick jump files I think you can get what you need.

    1) Create a text file and name it mod_dropdownmenu.php
    2) insert the flowing code into and save it.
    [PHP]<?php
    //Drop Down Menu//
    /**
    * Drop Down Menu Module
    * @package Joomla
    * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
    * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
    * Joomla! is free software and parts of it may contain or be derived from the
    * GNU General Public License or other free or open source software licenses.
    * See COPYRIGHT.php for copyright notices and details.
    */

    defined( ‘_VALID_MOS’ ) or die( ‘Direct Access to this location is not allowed.’ );

    $menu_name = $params->get( ‘menu’ );
    $ordering = $params->get( ‘ordering’ );
    $parent = $params->get(‘parent’);
    $style = $params->get(‘style’);

    if (true ) {
    // Assign ordering

    switch ($ordering) {
    case ‘descending’:
    $orderBy = ‘name DESC ‘;
    break;
    case ‘ascending’:
    default:
    $orderBy = ‘name ASC ‘;
    break;
    }

    // select the meta keywords from the item
    //$query = ‘SELECT * FROM #__menu WHERE menutype = ‘.$menu_name.’ AND published =’1′ AND parent != ‘0’ ORDER BY ‘ . $orderBy ;
    $query = “SELECT * FROM #__menu “
    . ” WHERE menutype = ‘”. $menu_name .”‘ “
    . ” AND published = ‘1’”
    . ” AND parent = ‘”. $parent .”‘ “
    . ” ORDER BY “. $orderBy;
    // echo $query;
    $database->setQuery( $query );

    $mymenu_content =”<form name=’Lnk’><select name=’GrpComp’ class=’inputbox’ style='”.$style.”‘
    onchange=’javascript:location.href=document.Lnk.GrpComp.options.value;’ >
    <option>– Select Company –</option>”;

    if ($mymenu_rows = $database->loadObjectList() ) {

    foreach($mymenu_rows as $mymenu_row) {

    $mymenulink = $mymenu_row->link;
    if ($mymenu_row->type != “url”) {
    $mymenulink .= “&Itemid=$mymenu_row->id”;
    }

    if ($mymenu_row->type != “separator”) {
    $mymenu_content .= ” <option value=””.sefRelToAbs($mymenulink).”” >$mymenu_row->name</option>r”;
    }
    }
    //$mymenu_content = substr($mymenu_content,0,strlen($mymenu_content)-2);
    $mymenu_content .= “</select></form>”;?>
    <table border=”0″ cellspacing=”0″ cellpadding=”0″ align=”center”>
    <tr>
    <td >
    <div align=”center”><?php echo $mymenu_content ?></div>
    </td>
    </tr>
    </table>
    <?
    }
    echo $database->getErrorMsg();
    }

    ?>
    [/PHP]

    3) create another file and name is mod_dropdownmenu.xml
    4) insert the following code into it

    <?xml version="1.0" ?>
    <mosinstall type="module">
    <name>Drop Down Menu</name>
    <creationDate>26-june-2006</creationDate>
    <author>Walid Nehme</author>
    <copyright>(c) 2006 Walid Nehme</copyright>
    <license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
    <authorEmail>walid@walidnehme.com</authorEmail>
    <authorUrl>www.walidnehme.com</authorUrl>
    <version>2.0</version>
    <description> This Module Creates a drop down menu listing all sub menu items from a menu. </description>
    <files>
    <filename module="mod_dropdownmenu">mod_dropdownmenu.php</filename>
    </files>
    <params>
    <param name="moduleclass_sfx" type="text" default="" label="Module Class Suffix"
    description="A suffix to be applied to the css class of the module (table.moduletable), this allows individual module styling" />
    <param name="@spacer" type="spacer" default="" label="" description="" />
    <param name="parent" type="text" default="" label="Parent Level"
    description="Enter the parent ID which you wish the menu to start from" />
    <param name="style" type="text" default="width:140px;height:18px;font-size:11px; padding-left:3px" label="Styling Options"
    description="Enter the Style type of your dropdown" />
    <param name="ordering" type="list" default="ascending" label="Sort By:" description="Sort Menu items in Drop down Menu by Ascending/Descending">
    <option value="ascending">Ascending</option>
    <option value="descending">Descending</option>

    </param>

    <param name="@spacer" type="spacer" default="" label="" description="" />

    <param name="menu" type="mos_menu" default="mainmenu" label="Menu" description="The name of the menu you wish the module to display - if no menu is selected the mainmenu is loaded" />

    </params>

    </mosinstall>

    5) save both files into a zip file and call it mod_dropdownmenu.zip
    6) install the zip as a module.

    The Parent id is the level at which you want to start your menu from it hierarchy

    :p

    jaway Friend
    #289423

    Thanks maclarkson

    I’ll see if I can figure it out. and then I’ll try it out.

    You don’t happen to have a live example somewhere where I can see the actual result?

    Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

This topic contains 5 replies, has 3 voices, and was last updated by  jaway 15 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum