Getting auto-nav NOT to go to a page when there are dropdown items

I’m working in v9.2 (a new version to me) and I’m trying to get autonav to have a dropdown menu which is displayed when the user clicks on it but does NOT go to a page, i.e. it just shows the dropdown items.

In a previous version (8.5.5) I had an attribute ‘disable link in nav’. I believe this was an option available n blocks/autonav/view.php however it seems that v9 does not support this behaviour, i.e. no ‘isEnabled’ item in the navItem object.

How can I achieve what I want?

One reason for this is that with it going to a page, it is not possible to click on any sub page on my Samsung android tablet. It works OK on my iPhone but not on the tablet (possibly an android or Samsung problem?)

I’ve found a way that seems to work but I’m not too happy with how ‘appropriate’ it is. It may cause problems down the line!

I added custom css to my skin adding css to the dropdown-toggle class…

.dropdown-toggle{
    pointer-events: none;
    cursor: pointer;
}

I’m just a bit uncomfortable about changing an existing class in this way.

Any comments from those more knowledgable than I, gratefully received!

1 Like

One thing you can do is set the attribute replace link with first in nav.

Sorry for the delay in replying - I’ve been out of commission.

Thanks for your suggestion but that doesn’t really do what I want. What I am trying to achieve is to click on a menu item (which has a sub menu) and not go to ANY page. I just want to display the sub menu.

I used to be able to do this in autonav in v8, which had an attribute ‘don’t follow link’ or something like that. This attribute is not available in v9’s implementation.

The reason for this is that autonav does not work properly on mobile devices. I used to be able to long-click on a men to display the sub menu but this doesn’t work on my Samsung android tablet (don’t know if it’s Samsung or android that causes the problem - I don’t have access to other android devices) and when I click on the ‘down arrow’, irt displays the menu but then goes to that page anyway. It DOES work on my iPhone, however, implementing my suggested solution of applying styling

#ubnavbar .dropdown-toggle {
  pointer-events: none;
  cursor: pointer;
}

works on android but then doesn’t work on iPhone!

Surely it’s not unreasonable to want to have dropdown sub menus?

Maybe I’m just missing something really obvious - or maybe v9 is flawed?

I have tried it on another Samsung android device and on this it DOES work as required when I click the down arrow but that is running a very old version of android (v4, compared with v10)

Having researched more in to this I think it may be tied in to the bootstrap version in use (5).

From my fairly limited understanding, the sub menu is not expected to appear when the mouse hovers but only when it is clicked. Can this in any way explain why I can’t see the menu when I click on android, it always goes straight to that page?