October 21st, 2012AWM: Highlight menu item
Knowledge Base support case for AllWebMenus, abstracted and stripped of all user’s private info.
Initial Email From: Claudio
Initial Email Subject: Highlight Menu Item
Support Case Month: April 2012
We developed a vertical menu for the page: http://www.miamiarch.org/ip.asp?op=Business_Offices, which opens the “Business Offices” section of the web site.
However, when I navigate the buttons on the top of the page (Non-Parochial Collections, Tamper Evident Bags and ADOM Financial Report), I lose my reference to the vertical menu. I would like to keep the item “Business Offices” inside “Business & Finance Office” highlighted.
I could use a script similar to :
<script type="text/javascript">
var awmShowItem=["vm,it7,1","hm,it12,2,0"];
</script>
which works perfectly in the project http://www.stakb.org/stagnes/School/school.asp?op=Art.
The problem is that this solution references on the ordinary position of the item in the list of menu items (1st, 2nd, 3rd, etc…). In the case of http://www.miamiarch.org/ip.asp?op=Business_Offices, I have a large number of menu items in the vertical menu and they constantly change. If I add a new menu item, it will change the ordinary position of the rest of the list, affecting the effectiveness of the JavaScript code above.
Is there a way I can refer to a menu items that will not be referenced to the ordinary position of the menu list?
I am trying to provide a similar experience of the pages in the section http://www.miamiarch.org/ip.asp?op=PGC_Policies_P&PGuidelines. In this case the vertical menu is pure HTML code, and the option “Safe Environment Procedures” is highlighted in the following 5 pages:
· http://www.miamiarch.org/ip.asp?op=PGC_Policies_P&PGuidelines
· http://www.newmiamiarch.org/ip.asp?op=PGC_Policies_Employees
· http://www.newmiamiarch.org/ip.asp?op=ParishSchoolCarnivalPolicy
· http://www.newmiamiarch.org/ip.asp?op=PGC_Policies_SafeEnvironment
· http://www.newmiamiarch.org/ip.asp?op=PGC_Policies_Volunteers
Claudio
Reply From: Likno Customer Support
Dear Claudio,
If I understood correctly, then you do not need to have ANY code in your pages.
Just choose the automatic highlight option:
This will automatically highlight the menu item that corresponds to the current page URL.
Note that if you forget your old “awmShowItem” code in a page, it will overwrite the automatic highlight.
Regards,
Kostas
Likno Customer Support
www.likno.com
Create any type of javascript menu (CSS menu, drop-down menu, sliding menu), button, html tree, modal window, tooltip, accordion, tab, scroller, jQuery slider or design for your websites!
Like us on Facebook – Follow us on Twitter
Reply From: Claudio
Kostas,
Thanks for responding to my email so quickly.
I know the option below, but that is not what I need.
That resource is activated and it works automatically when the URL is the same as in Webmenu.
However, there are pages inside the web site that are NOT listed in the menu items, but they do belong to a section of a page.
The page http://www.miamiarch.org/ip.asp?op=Business_Offices makes the menu option “Business Offices” highlight automatically as per the setting you described below.
However, there are 3 other buttons on the top of the page (pure HTML buttons), that link to other pages, related to “Business Offices”.
I want to use the JavaScript code to highlight the menu option, but I don’t want to use a reference to the ordinary position of the menu, because I know it will change during the course of the year. Now Business Office is the 2nd position of the vertical menu, but tomorrow it may be the 3rd.
Most importantly, I would be using the JavaScript code in several other places in this vertical menu. Can you imagine how difficult it will be to update several JavaScript codes every time I add or remove a menu option?
Claudio
Reply From: Likno Customer Support
Dear Claudio,
Ok, now I understand what you mean. However there has been a misunderstanding…
When you write:
var awmShowItem=["vm,it7,1","hm,it12,2,0"];
The “it7” is the ID of this specific item. It is NOT just its order in the menu. If you add other items before or after it, this item will still be referenced by “it7”.
Regards,
Kostas
Likno Customer Support
www.likno.com
Create any type of javascript menu (CSS menu, drop-down menu, sliding menu), button, html tree, modal window, tooltip, accordion, tab, scroller, jQuery slider or design for your websites!
Like us on Facebook – Follow us on Twitter
Tags: code, css menu, drop-down menu, highlight, html, item, JavaScript, javascript menu, jquery, list, Menu, navigate, page, position, script, sliding menu, URL, vertical menu, website