How to show the menu in your application

Once the load procedure was created by the K2BMenu pattern you may want to show the menu in your master page or in another Web Panel.

Adding the menu to the master page - Using the GAM integration module.

If you are going to use GAM, and you want to integrate it with K2BTools, the accordion menu will appear after the GAM integration module is installed. Just make sure that the procedure K2BGetUserMenu is called inside the master page you are using (by default all K2BTools master pages include the call to that procedure).

Adding the menu to the master page - without using the GAM integration module.

The K2BAccordionMenu is loaded by calling the procedure K2BGetUserMenu. In order to include the call to the generated menu you must edit this procedure. 

// To be completed by developer
// Returns the user menu
K2BListPrograms.Call(&ListPrograms)
&MenuItems = K2BListProgramsToMultiLevelMenuSDT(&ListPrograms)

K2BAccordionMenu default SDT Load in K2BGetUserMenu

You must change it in order to call the load procedure. If the procedure generated by K2BMenu Pattern is called K2BMainMenuStaticMenuLoader, you must substitute the code above with the following code. 

&MenuItems = K2BMainMenuStaticMenuLoad.Udp()
K2BAccordionMenu customization to load SDT with a K2BMenu Pattern generated procedure

Adding the menu in other Web Panels (or Master Pages)

If you want to use the menu in another webpanel or master page, you must follow this steps

  1. Go to the webform part of the webpanel and place the Accordion Menu user control in the webform. 
    K2BAccordionMenuInWebForm
    K2BAccordionMenu in WebForm

  2. Go to the events part and add the following code in start event 
    &MenuItems = K2BMainMenuStaticMenuLoad()
    K2BAccordionMenu event start code

Adding the menu in Master Pages based on K2BWWMasterPageFlat imported in versions lower than K2BTools 11.

Master Pages based on K2BWWMasterPageFlat already include the K2BAccordionMenu user control in their Web Form. Because of this, the developer only needs to load the menu options in the Master Page events part.

To do so, the master page (named K2BWWMasterPageFlat by default) must be opened and the code must be changed, so the generated procedure is called to load the K2BAccordionMenu user control.

By default the K2BAccordionMenu is loaded using the K2BListPrograms procedure. 

You must change it in order to call the load procedure. If the procedure generated by K2BMenu Pattern is called K2BMainMenuLoader, you must substitute the code above with the following code. 

&MenuItems = K2BGetUserMenu.Udp()
K2BAccordionMenu customization to load SDT with a K2BMenu Pattern generated procedure

Inside the K2BGetUserMenu you must call K2BMenu generated procedure.