horizontal menu question

General questions about CMSimple
Post Reply
milkodb
Posts: 31
Joined: Sun Jun 23, 2013 11:00 pm
Location: Italy

horizontal menu question

Post by milkodb » Mon Feb 16, 2015 9:35 pm

...Hi all,

Using xtoc (function #4) for horizontal menu and all is ok. The problem is styling first level voice when a sub-voice (level 2 or level 3) is active.
So user know in which menu is the current active page when mouse isn't on menu.

I.E. if menu voice "third item" of menu "second menu" is pressed, the "second menu" menu label (first voice, label of this menu) changes color or other.

Really, this is possible via CSS for <home> (or other voices of menu when not "category") but not for "category" menu. I noted menu voices are one and only a "ul" list and not separated "ul" lists, so number of list elements are progressive. I think solution is assign a new class to "first level" elements assuming to be able to identify the first voice of each menu in which a sub-voice is active.

Searching all web I've found something for CMS standard "li function" in "cms.php", but for _xh it seems to me this fnc is different and lies in tplfunct.php.

Someone can tell me a suggest?

Thanx
Milko

cmb
Posts: 12598
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: horizontal menu question

Post by cmb » Mon Feb 16, 2015 10:36 pm

milkodb wrote:Using xtoc (function #4) for horizontal menu and all is ok. The problem is styling first level voice when a sub-voice (level 2 or level 3) is active.
So user know in which menu is the current active page when mouse isn't on menu.
In CMSimple 2.8 the configuration option menu_sdoc has been introduced. If this is set to "parent" then all ancestors of the selected page also get the CSS class sdocs. The original xtoc contains modified copies of an earlier CMSimple version, so this setting is not catered to. Therefore xtoc28 has been made, but unfortunately this only contains mode #3 of xtoc.
milkodb wrote:Searching all web I've found something for CMS standard "li function" in "cms.php", but for _xh it seems to me this fnc is different and lies in tplfunct.php.
During the 1.6.x branch the menu generating functionality has been refactored (which is still work in progress) to avoid the need for alternative menu solutions such as xtoc, AdvancedTOC etc., which always will have the problem that they become out-dated.
milkodb wrote:Using xtoc (function #4) for horizontal menu and all is ok.
Do you need only spaces (BREAK_) or also categories (CATEGORY_)? At least in the former case you could try a plugin which is only a rough draft: http://3-magi.net/downloads/menuclasses.zip. This plugin allows to set arbitrary CSS classes to individual pages (via tabs above the editor), and you can use these classes in the template's stylesheet. To make the new menu available, you have to replace the following in your template:

Code: Select all

<?php echo xtoc();?>
with:

Code: Select all

<?php echo toc(null, null, 'menuclasses_li');?>
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

milkodb
Posts: 31
Joined: Sun Jun 23, 2013 11:00 pm
Location: Italy

Re: horizontal menu question

Post by milkodb » Tue Feb 17, 2015 12:04 am

HI CMB, thanks for reply and rapidity...

...yes, actually I tried with "_sdoc" parent syntax and it really doesn't work.
I'll try downloading the plug-in...

again thanks for the answer.
Milko

Post Reply