mouseover submenu

Mouseover submenu, a forum discussion on Jojo CMS. Join us for more discussions on Mouseover submenu on our Suggestions & Feedback forum.

Back to Forum Index : Back to Suggestions & Feedback   RSS
dennyhalim

26 Apr 2009
Posts: 44

a menu system similar to jojo admin.
all sub menu accessible without have to open the parent page.

example on jojocms.org site.
when we mouseover on downloads, let it show all downloads subpages. ie, plugins, svn, etc...
tnx for great free jojocms
Rick Rick

26 Apr 2009
Posts: 336

This would be done by whoever codes up the theme, rather than Jojo.

The menus on jojocms.org and the Jojo admin are different, one is nested, one is two menus. Alignment gets tricky with nested horisontal menus. But all you need is to write the code to handle it, maybe do the hover with jQuery or see any of the free css menu sites for examples to achieve it without javascript.
Harvey

Core Developer

Harvey

28 Apr 2009
Posts: 327

Jojo will produce the HTML in a standard <ul><li><a>foo</a></li></ul> structure, and it's up to you to provide CSS for it. This can be really tricky depending what you are trying to achieve.

There should be plenty of off-the-shelf CSS/jQuery you can apply to Jojo to get the look you need - most menus follow an identical HTML structure to what we use.
dennyhalim

4 May 2009
Posts: 44

i think you didnt get what i'm suggesting...


example jojocms.org site:

currently, download submenu only shown after we go to download page.
feature submenu only shown when we go to feature page.
so, on download page, we didnt have feature submenu. vice versa.

so, example after i see feature page, i cannot directly go to 'release note' which is under download submenu.
i have to click download first, only then i can click 'release note'

i like to have all submenu displayed under each menu so that we can navigate to any child page without have to go to the parent page first.

tia.
tnx for great free jojocms
tom

Developer

tom

4 May 2009
Posts: 379

that's down to how you set up your global.php, template and menu javascript - all submenus (afaik) are returned in the $nav array we use, and the template sets which get displayed and when eg:

{foreach from=$nav item=n}
<li><a href="{$n.url}">{$n.pg_title}</a></li>
{if $n.subnav && (in_array($n.pageid, $selectedpages) )}
<li class="subnavlist">
<ul>
{foreach from=$n.subnav item=s}
<li><a href="{$s.url}">{$s.pg_title}</a></li>
.....


this line:
{if $n.subnav && (in_array($n.pageid, $selectedpages) )}
tells smarty to only display the subnav items if the parent is in 'selected pages' - so it will only show subnav when in that section.

if you change it to :
{if $n.subnav}
it will display the subnav for any menu item that has it (which you could then hide/show on rollover using javascript)


it may be that you need to create your own nav in global.php if the default one is not giving you all the levels you want. We use this one:

/* Create navigation array */
$root = 0;
if (_MULTILANGUAGE && isset($page)) {
/* If on a multilanuage site, get the root for the current language */
$mldata = JOJO::getMultiLanguageData();
$root = $mldata['roots'][$page->getValue('pg_language')];
$smarty->assign('home', $mldata['homes'][$page->getValue('pg_language')]);
$smarty->assign('root', $root);
}
/* assign navigation: _getNav() = ("home page", "# Levels of sub nav") */
$smarty->assign('nav', _getNav($root, 3));
$smarty->assign('footernav', _getNav($root, 0, 'footernav'));

if (isset($selectedPages[2])) {
$smarty->assign('subnavparent', $selectedPages[1]);
$smarty->assign('subnav', _getNav($selectedPages[1], 0));
$subsubnav = _getNav($selectedPages[2], 0);
$smarty->assign('subsubnav', (boolean)count($subsubnav));
} else {
/* Get children pages of this page */
$smarty->assign('subnavparent', $page->id);
$smarty->assign('subnav', _getNav($page->id, 0));
}
dennyhalim

8 May 2009
Posts: 44

that's it. great. tnx!
tnx for great free jojocms
Back to Forum Index : Back to Suggestions & Feedback   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.