PDA

View Full Version : Make top level menu item "selected" like a tab...


cbataglio
08-02-2007, 10:57 AM
hello

i'd like to configure my udm menu such that a class like "selected" can be used to allow a top level link to be "higlighted" when on a specific site page, sort of like an active tab... can this be done?... any advice on how this can be done?

thanks

bcarl314
08-02-2007, 02:54 PM
Yep, this can be done with the "you are here" extension.

http://www.udm4.com/menu/modules/youarehere/

cbataglio
08-03-2007, 04:50 PM
Hi,

I downloaded the .js and I am looking at the instructions, but I am not really clear...

How to I configure the .js params? I can't make heads or tails of the instructions. Do you have a working code example I can look at?

Also, into what file would I copy and paste the additional .CSS style code?

Thanks

Charles

bcarl314
08-06-2007, 06:56 PM
The first thing you will need to do is add the javascript to your pages.

Put this AFTER all your other udm body script calls.

<!-- you are here extension -->
<script type="text/javascript"
src="/udm-resources/udm-x-youarehere.js"></script>


Next, you will need to configure the javascript file. Open the udm-x-youarehere.js file. There are only 5 configuration options...


var youAreHere = [
'index.php', // default page name [eg "index.php", "default.html" etc]

This is the "default" page for a directory. Usually this is index.html, index.htm, or similar. This is the page that would be loaded when you time http://www.example.com/somedirectory/ as this actually loads http://www.example.com/somedirectory/index.html

This is needed so the script knows that it's supposed to highlight / select the right menu item.


'You are here: ', // add text to here-page title ["text"|"none"]


This is text that can be added to the current page in the menu when you mouse over the item. It is optional and can be removed.


'You are in this branch: ', // add text to here-branch title ["text"|"none"]


This is the text that can be displayed when you mouse over a "parent" item in the menu. Also optional.


'before', // where to add title text ["before"|"after"]


For the previous two options, you may have the title "prepended" (before) or "appended" (after) the default text. To see these in use, go to http://www.udm4.com/menu/modules/youarehere/ . When you mouse over the "About" menu, you'll see the hover text "You are in this branch: About UDM", when you open a submenu and get to the "Modules and Extensions" you will see the "You are here:" title text.


'no', // open here-branch menus automatically ["yes"|"no"]


Setting this option to "yes" will auto-expand the menu on page load. This works best if the menus are not "flyout" style menus.

Hope this answers any questions.