This guide will explain how to integrate RadMenu 4.x in the DotNetNuke Portal version 4.5. It assumes that you have DotNetNuke installed.
Step 1 - Installation
If you do not have the RadMenu skinobject yet, download the archive from your Client.Net account.
- Unpack the archive in a folder of your choice. You should have the following files - Telerik.DNN.SkinObjects.Menu.zip, RadMenu.zip, a skinning whitepaper, and Skinobjects-Menu-Readme.htm.
- If you have purchased a Developer license, then you need to open the Telerik.SkinObjects.Menu.zip archive and replace the RadMenu.dll file with the one from your developer installation(usually from C:\Program Files\telerik\).
- Open your browser and go to the DotNetNuke portal. Log in with a SuperUser account(host). Go to the menu Host>Module Definitions. From the bottom of the page click on Install New Module. Point to the Telerik.DNN.SkinObjects.Menu.zip file, click Open and then click Install New Module.
- Go to the skins page(Admin>Skins or Host>Skins) and click on the Upload Skin link located near the bottom of the page. Select the skin you will use with RadMenu or select the sample skin that comes with the RadMenu skinobject - RadMenu.zip. Click Open and then Install Skin Package. After the skin installation is complete you can go back to the Skins page and preview/apply the new skin.
- Congratulations! You have successfully integrated RadMenu in your DotNetNuke project.
Step 2 - Customization
Customizing RadMenu after its integration in DNN can become a bit more difficult than what you are used to, since there is no XML definition file for the structure of the menu. The items are generated dynamically in order to reflect all page changes in the DNN menu structure. This brings a problem for people who are used to tweaking the XML file for best results. However, we tried to minimize this problem by exposing as many properties as possible in the skinobject. You can add those properties from the skin definition file(.ascx) (method A) or in the XML definition file for your skin (method B). For example if you want to tell the menu where to look for its images you will need to set the its ImagesBaseDir property.
Method A
This method relies on directly modifying the ascx file. However, if you parse the skin package the changes will not persist - the xml settings will override your modified ascx file. The advantage of this method is that you can tweak the ascx file and immediately see the changes after refreshing the page.
If your skin file comes with a ready to use control file(.ascx) the menu should look something like this:
First you should register the control:
| ASPX |
Copy Code |
|
<%@ Register TagPrefix="dnn" TagName="RADMENU" Src="~/DesktopModules/RadMenu/RadMenu.ascx" %> |
Then you should put it somewhere in your skin:
| |
Copy Code |
|
<dnn:RADMENU runat="server" id= "dnnMENU" /> |
You add properties in the same way as you would do on a normal RadMenu:
| |
Copy Code |
|
<dnn:RADMENU runat="server" id="dnnMENU" ImagesBaseDir="~/Portals/_default/Skins/myskin/Img/"/> |
Method B
This is a more indirect method which modifies the xml file which after parsing produces the ascx file from method A.
If you are building skins using an HTML editor and the DNN skin parser:
First place the RadMenu token([RADMENU]) somewhere in your skin, then you need to add the properties to the XML file that holds information about the tokens you are using. For example:
| |
Copy Code |
|
<Object> <Token>[RADMENU]</Token> <Settings> <Setting> <Name>ImagesBaseDir</Name> <Value>~/Portals/_default/Skins/myskin/Img/</Value> </Setting> </Settings> </Object> |
Step 3 - Skinning whitepaper
Consult the skinning whitepaper for a list of all properties supported by the RadMenu skinobject.
Known Issues
The actions menu skinobject throws an exception if Medium trust level has been selected from the Web.config file. If you see an exception similar to this:
DotNetNuke.Services.Exceptions.PageLoadException: Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
then you should remove the following line from your Web.config file: <trust level="Medium" originUrl="http://localhost/.*" />