Monday, February 23, 2009

Deleting and Adding menu items

Many people asked me about adding or deleting menu items in UCM, it is easy to do this with UCM.

The steps to customize menus
1- Create a custom component, or use an existing one
2- Add new resource file to the component that file type is "HTML Include"
3- Add new include with the following name "custom_finish_layout_init" where it is an existing include that creates menus and we want to customize it
3- Inside that include write the following

// First we will call the parent definition for menus
<$include super.custom_finish_layout_init$>

// If we want to delete "My Profile" link

// Now we will add new menu item and we will add one child link to that menu item
// Check if the menu has been added before
<$if not MyScreensMenu_included$>
// add a drop-down menu, or a tray to the UI, that new menu item will be called "My Screen"
navBuilder.addChildNodeTo('NAVTREE', 'collection', 'id==MyScreens', 'label==My Screens');
//Now check if we are using Top Menus layout
if (navBuilder.menuB)

//Or we are using Trays layout
else if (navBuilder.trayA)

// Flag that the new menu item has been added
<$MyScreensMenu_included = 1$>

//At last add the link to the menu item that link called "Link 1"
navBuilder.addChildNodeTo('MyScreens', 'item', 'id==link1', 'label==Link 1', 'url==');

The code in blue is javascript code and in red is idocscript, also notice the following idocscript variable "MyScreensMenu_included" only defined when we used it that is because idocscript language doesn't need you to define variable before using them (Unchecked types language)


Anonymous said...

Your blog keeps getting better and better! Your older articles are not as good as newer ones you have a lot more creativity and originality now keep it up!

Hisham Galal said...

Thanks for your words. I will try to improve my blog especially during this new year 2010.

Anonymous said...

miley cyrus nude [url=]miley cyrus nude[/url] paris hilton nude [url=]paris hilton nude[/url] kim kardashian nude [url=]kim kardashian nude[/url] kim kardashian nude [url=]kim kardashian nude[/url]