No active state class navigation (CSS)

5
For several projects we've run into the issue that navigation items don't get a active class (did work in Mendix 4, but nog in Mx5). That means that navigation is useless for every project that has a different styling of active navigation items. I already filed a ticket / feature request for this, but in the mean time I'm curious if there are some work around. Also I would like to know if anyone else experienced this as an issue, because I can back-up my ticket with this thread (to get more priority ;)).
asked
6 answers
3

Maintaining the state of widgets that are placed in layouts is very high on our backlog. The idea is to only replace the parts of the page that have changed. This would fix the "active class" problem, but also the fact that, for example, a tree widget collapses when you navigate to a different page.

answered
0

We had the same issue. Solution was to create seperate snippets and layouts for each navigation item. Would be great if modeler would support active states!

answered
0

@Charles: yeah, but when you use sub navigation even that is not really an option.

In the mean time I've developed a widget that does this. Anyone interested can contact me via www.appronto.nl/contact/

answered
0

I'm trying to create a widget for this. For the tree menu it works fine because the tree menu is available in the DOM when executing the post create function of the widget.

The default (horizontal) menu gives a problem. It seems that in the postCreate of the widget the menu ul and li structure is not build. The only thing available in the postCreate is this:

<div data-mendix-id="13871" data-mendix-type="mxui.widget.Navbar" data-mendix-props="&quot;menuID&quot;:&quot;159b6aef-dbc3-5b23-a735-cf99f8341771&quot;" class="menu-1"></div>

The tree menu does have list content, the Navbar doesn't. Anyone ideas? If I can accomplish that the widget is executed after the menu has content than I can complete a widget that set active CSS class for active menu items.

answered
0

I am encountering the same issues when I use the vertical navigation,does anyone know if this has been fixed in newer versions of mendix?

answered
0

Bumping this.  I have an older project where the "active" class is being applied to the menu item but not on newer projects.  The older one is in 6.10.2, the newer one is in 7.2.0.

answered