PortalCS
Hierarchical menu server control --- if you like what I have
done "Tell your Boss to Hire Me"
Dennis West
ASP.Net aspace
Wednesday May 22, 2002.
To implement a horizontal tab bar that will give you the
flexibility of a Hierarchical Menu in your portal application and inherit the
intrinsic value of the Portals database driven display of page information and
the Portals Admin Edit capability you will need to follow the following
instructions.
Download the following documentation and code from ASP.NET Control
Galley
cMenu
ASP.NET menu server control
http://www.dev1.eraserver.net/CTRLTEST/
This will get you the details of the Menu. Developed by:
cMenu ASP.NET menu server control
Yasser Maree
Riyadh, SA.
Monday, April 15, 2002.
Download cMenu beta (Component + Samples)
This will get the Menu Code. http://www.dev1.eraserver.net/CTRLTEST/cMenu.zip
What you need from this download will be the mlcMenu.dll.
Product Details cMenu is ASP. NET server control that
creates flexible menus for the web. cMenu is a visual ASP .NET component that
enables customization of visual parameters, such as fonts, colors, borders,
sizes, etc. Includes a top level menu - which can be oriented both horizontal
and vertical, configurable submenu levels. The menu structure is obtained from
an XML file. All the options can be modified through the component properties
and from VisualStudio.NET designer.
To
Implement the Horizontal Tab Bar in PortalCS do the following:
To implement a horizontal tab that will give you the
flexibility of a Hierarchical Menu in your portal application and inherit the
intrinsic value of the Portas database driven display of page information and
the Portals Admin Edit capability you will need to follow the following
instructions.
Add a Tab and page layout as per the Portal Instructions.
You can add as many tabs and pages as needed.
Modify and Build the following Controls:
Build a Horizontal.ascx User Control
<%@ Control %>
<%@ Register TagPrefix="mintLab"
Namespace="mintLab.webServerControls" Assembly="mlcMenu" %>
Html code:
<tr valign="top">
<td
align="left">
<MINTLAB:CMENU
id="CMenu1" runat="server" XmlDataFileName="MenuData.xml" FontFamily="verdana"
FontSize="8" FontBold="0" FontItalic="0" TopMenuBGColor="FFFBF7"
BGColor="FFFBF7" BGColorOver="B5BED6" TopMenuBorderColor="636563"
BorderColor="636563" TopMenuFontColor="Black" FontColor="Black"
TopMenuFontColorOver="Black" FontColorOver="Black" MenuWidth="150" Left="100"
Top="85" SeparatorColor="FFFBF7" TopMenuIsHorizontal="true"
IsHorizontal="false" RightToLeft="false" DisplayOnClick="false"
TopMenuIsVariableWidth="false"
IsVariableWidth="false"></MINTLAB:CMENU>
</td>
</tr>
Modify DesktopPortalBanner.ascx user Control
In the DesktopPortalBanner.ascx ....modify the following
highlighted code:
For the IbuySpy portal there are 5 tabs shown in user mode
once
a hidden tab has been add to the portal menu you must modify
this
snippet of code in the DesktopPortalBanner.ascx user control
// Build list of tabs to be shown to user
ArrayList authorizedTabs = new ArrayList();
int addedTabs = 0;
for (int i=0; i < portalSettings.DesktopTabs.Count; i++) {
TabStripDetails tab = (TabStripDetails)portalSettings.DesktopTabs[i];
if (PortalSecurity.IsInRoles(tab.AuthorizedRoles)) {
if(i != 5) { //do not show hidden tab
//(modify this line for each added hidden tab:)
// like: if((i ! = 5)&& (i ! = 6)&&(i ! = 7)&&(i ! = 8))
authorizedTabs.Add(tab); //add viewable
tab
}
}
if (addedTabs == tabIndex) {
tabs.SelectedIndex = addedTabs;
}
addedTabs++;
}
Modify DesktopDefault.aspx user Control
Add the following highlighted code to the DesktopDefault.aspx
user Control
<%@ Register TagPrefix="mintab" TagName="Horizontal"
Src="Horizontal.ascx" %>
and add the highlighted Horizontal tabs to the HTML.
<tr valign="top">
<td
colspan="2">
<portal:Banner id="Banner" runat="server"
SelectedTabIndex="0"></portal:Banner>
</td>
</tr>
<tr valign="top" align="left">
<td>
<mintab:Horizontal id=
"Horizontal"runat="server"SelectedTabIndex="0"></mintab:Horizontal>
</td>
</tr>
Build or Modify the MenuData.xml file
Build or Modify the MenuData.xml file For each hidden tab
modify the followng link: as highlighted by this example this link will point
to the hidden tab and execute the pagelayout for that tab. giving you all the
attributes of the portal intristic display and admin edit functions. The
remaining sample code provide external links and or possible link to hidden
tabs.
Modify the Url links in MenuData.xml for a hidden tab
button like Url="DesktopDefault.aspx?tabindex=5&tabid=8" />
Add the mlcMenu.dll to the PortalCS Bin Directory
Add the new Horizontal.ascx to the PortalCS Directory
Add the modified MenuData.xml to the PortalCS Directory