• Page 1 of 1
  • 1
Forum moderator: bigblog  
uCoz Community » For Webmasters » Custom Solutions » Issue with highlighting menu items. (Menu items with custom links don't work the same as modules)
Issue with highlighting menu items.
InteLStaT
Posts: 2
Reputation: 0

Message # 1 | 5:44 PM
My problem probably wouldn't be hard to solve with a little bit of javascript tinkering but I'd like to know if this is an internal issue with uCoz or I'm not doing things properly.

Everyone's familiar with uCoz menus, right? Well, they are a little bit too simple in my opinion. You know, menu items have a link associated with them, which is usually just the main page of a module (or a custom page). What is nice about this is that if you're on a module's page and there's a menu item pointing to that module, that menu item gets highlighted (e.g. becomes bold/changes color, whatever). Under the hood what happens is that uCoz adds a CSS class, uMenuItemA, to that menu item.
BUT.
That only happens if the menu item is pointing to the module directly. If the menu item is pointing to a specific article/entry, and you visit that article's/entry's page, the menu item isn't highlighted AT ALL. Which is a little bit upsetting, because custom menus are pretty pointless if you can only use them for pointing to the main page of modules.

If you're confused what I'm talking about, here's how to reproduce it.
  • On your website, add a new news article for example.
  • Copy the link of that news article.
  • In the control panel, add a new menu item to the main menu. (If you have a custom menu, you can add it there too, but make sure the highlighting works properly for it on module pages)
  • Paste the news article's link to the menu item's URL box.
  • Save.
  • Open your website, click on the new menu item. The news article opens. Boom, absolutely no highlight at all.


So again, is this an unsupported feature or a bug? I'd really like if I didn't have to use javascript for this really simple thing. Thanks in advance for any help.
Gromov
Posts: 616
Reputation: 14

Message # 2 | 9:45 AM
InteLStaT, okay, please specify the URL of your website and provide the screenshots of what exactly are you referring to, since I'm a little bit confused.

Also, please specify what template do you use, a standard one or a custom one.
InteLStaT
Posts: 2
Reputation: 0

Message # 3 | 2:46 PM
I'm using template #1714. I've modified some of the HTML templates and added some CSS rules but didn't remove any of the default CSS styles.
I am actually using a second menu bar, that's where my problematic menu items will be. But the main menu would have the same issues (I tested it), so the fact that I'm using a custom menu bar doesn't change anything.

http://kicsivagyok.ucoz.ro/publ/

You can see a custom menu bar on the left that I customized with CSS.
Under the menu item "Fizika", there's a menu item "Mechanika". Clicking on it brings you to a Publisher module entry.
I want that "Mechanika" menu item to be highlighted when I am on the entry's page. But it doesn't get highlighted because uCoz doesn't add the uMenuItemA CSS class to the menu item (you can check it with the browser's HTML inspector). My javascript code that processes the menu bar also relies on the fact that uCoz adds this uMenuItemA class to the menu item. But since there's no uMenuItemA, my code doesn't work either.
I can only get the menu item to be highlighted if I set the menu item's URL to "/publ/ for example. But that's useless, because that's not what I want.
I hope I made it clear. Thank you.

Picture: https://i.imgur.com/cY4sRx6.png
Post edited by InteLStaT - Monday, 2018-08-13, 2:47 PM
joexyz
JOE-vascript
Posts: 1770
Reputation: 78

Message # 4 | 10:39 PM
InteLStaT, hrrrr, I remember this issue. I've faced the same problem in the past and I remember fixing it somehow but I think I decided not to use the uCoz menu at all and just make a new global block that contained my menu.
hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau

sometimes i lurk here
uCoz Community » For Webmasters » Custom Solutions » Issue with highlighting menu items. (Menu items with custom links don't work the same as modules)
  • Page 1 of 1
  • 1
Search: