Elxis CMS Forum

Support => Elxis 4.x/5.x DEV => Topic started by: speck on November 16, 2012, 10:05:52

Title: class="menu_active" only on first level !!!! other levels ???? [SOLVED]
Post by: speck on November 16, 2012, 10:05:52
if i want create a vertical menu (accordion or classic menu) is not possible to open the active link on second and other levels.
class="menu_activeu" only on first level, but second, third etc --- nothing, so when i click on a link menu of second level, all second level not remain expanded

Title: Re: class="menu_active" only on first level !!!! other levels ???? [SOLVED]
Post by: speck on November 17, 2012, 12:28:52
I've added in mod_menu this line:

line 78     if ($this->elxis_uri == $item->link) {
in
line78       if (strpos($item->link, $this->elxis_uri) !== false) {

under the result as accordion menu and it works ... maybe must be implemented mod_menu
Title: Re: class="menu_active" only on first level !!!! other levels ???? [SOLVED]
Post by: datahell on November 17, 2012, 20:29:30
Better create your own menu module instead of modifying the built-in one.
Avoid "style" attribute on menus as it is not compatible to some mobile devices and tablets.
Title: Re: class="menu_active" only on first level !!!! other levels ???? [SOLVED]
Post by: speck on November 17, 2012, 22:25:36
sorry, but is a simply menu_active class that already exist on first level when the page of article link is open

if ($this->elxis_uri == $item->link) {
               $liclass = ' class="menu_active"';
            } else if (($item->link == '') && $this->is_frontpage) {
               $liclass = ' class="menu_active"';
            } else {
               $liclass = '';
            }

for articles
 $item->link has value equal to "content:famous-places/taj-mahal.html"

in this case i'll have $liclass = '' not $liclass = ' class="menu_active"';
when the page http://localhost/famous-places/taj-mahal.html is showed

it works if $item->link has value equal to "famous-places/taj-mahal.html"
or better if in the Elxis link in manage menu not has content:
but if someone forgett to delete "content:" from Elxis link, not works

i solved in this way
Code: [Select]
if (strpos($item->link, $this->elxis_uri) !== false) {
$liclass = ' class="menu_active"';
} else if (($item->link == '') && $this->is_frontpage) {
$liclass = ' class="menu_active"';
} else {
$liclass = '';
}


about style u mention is the js used for accordion menu in the template add style="bla bla bla" at the ul
Title: Re: class="menu_active" only on first level !!!! other levels ???? [SOLVED]
Post by: datahell on November 18, 2012, 10:32:47
Read this. (https://forum.elxis.org/index.php?topic=7304.msg47453;topicseen#msg47453)
 :o
Title: Re: class="menu_active" only on first level !!!! other levels ???? [SOLVED]
Post by: speck on November 18, 2012, 11:36:36
 :o
there's a bug

no class=menu_active on first level  ;D

it's okay only on link home
but on links of categories, articles (without content:) not works on any level.

ahi ahi ahi datahell  :( .... a little bit of holiday u need it .... u worked too much hard  :(

my solution is better  ;D
test it  ;)
http://elxis4.elxisitalia.com/applestyle

(now problem to enter in admin area .... grrrrrrrrr )