Tuesday, May 13, 2008 | , Login
 
Support > radEditor Html provider - Overview
Go to RadMenu
Go to RadPanelbar
Go to RadTabStrip
Go to RadTreeView
 
 RadEditor provider - Overview

DotNetNuke Integration Manual
(Special thanks to Oliver Hine for his RadHtmlEditorProvider for DotNetNuke)
This guide will explain how to integrate RadEditor 7.x in the DotNetNuke Portal version 3.x. It assumes that you have Microsoft Visual Studio .NET and DotNetNuke installed with the RadHtmlEditorProvider (see RadEditor provider - installation).

Configuring the provider

The RadHtmlEditorProvider can be configured through the Web.config file of you DotNetNuke project. Be aware that the changes will affect all portals. The properties should be added to the tag:
<add name="RadHtmlEditorProvider"...
in the Web.config file. Most of the properties have the same names and function in the same manner as they do on a normal editor(see the online documentation). Here is a list:


Name Default Value Description
ThumbSuffix
Gets or sets the suffix, which is added to the original file name of the image to form the file name of its thumbnail.
AllowCustomColors
Gets or sets the value indicating whether the user should be allowed to add custom colors to any color picker palette.
AllowScripts
Gets or sets the value indicating whether script tags will be allowed in the RadEditor content.
AnchorPathToStrip
Gets or sets the part of the absolute anchor URLs which will be removed when StripAbsoluteAnchorPaths is set to true.
CausesValidation
Gets or sets the value indicating whether the [Update] button should perform validation when clicked.
ConvertFontToSpan
Gets or sets the value indicating whether the client-side filter that converts the FONT tags to SPAN tags is enabled.
ConvertTagsToLower
Gets or sets the value indicating whether the client-side filter that converts the RadEditor content enclosing tags to lower case is enabled.
ConvertToXhtml
Gets or sets the value indicating whether the client-side filter that converts the RadEditor content to XHTML is enabled.
CookieExpirationTime
Gets or sets the time-out period (in minutes) allowed between requests before the expiration of the cookie, used for storage of the RadEditor's dialog related data.
CssFiles
Gets or sets the list of external CSS files that should be made available in the editor's content area.
EnableClientSerialize
Gets or sets the value indicating whether RadEditor will save the state and positions of its toolbars and modules into a cookie.
EnableContextMenus
Gets or sets the value indicating whether the RadEditor context menus are enabled.
EnableDocking
Gets or sets the value indicating whether the RadEditor toolbars and modules are able to dock.
EnableEnhancedEdit
Gets or sets the value indicating whether the RadEditor will display the HTML tables with dashed borders, will mark the form elements, etc.
EnableHtmlIndentation
Gets or sets the value indicating whether the RadEditor should display the [Indent HTML] checkbox.
EnableServerSideRendering
Gets or sets the value indicating whether the RadEditor will render its toolbars on the server.
EnableTab
Gets or sets the value indicating whether the RadEditor will insert four empty spaces when the user presses the [Tab] key.
FileEncoding
Gets or sets the code page number used to encode the RadEditor content when saving it into ASCX or ASPX file.
FocusOnLoad
Gets or sets the value indicating whether RadEditor content area should get the focus on itself on load.
ImagesPathToStrip
Gets or sets the part of the absolute IMG URLs which will be removed when StripAbsoluteImagesPaths is set to true.
NewLineBr
Gets or sets the value indicating whether the RadEditor will insert a new line or a paragraph when the [Enter] key is pressed.
RadSpell
Gets the RadSpell object that RadEditor uses for spellchecking.
RadSpellTypeName
Gets or sets the fully qualified RadSpell type name, including the assembly name, version, culture, public key token.
RenderAsTextArea
Gets or sets the value indicating whether the RadEditor will render as TextArea.
Skin
Gets or sets the name of the skin that is used by all editor components - toolbars, dialogs, etc.
SkinsPath
Gets or sets the relative path of the folder containing the skins.
ShowHtmlMode
Gets or sets the value indicating whether the [Html Mode] icon will be displayed.
ShowPreviewMode
Gets or sets the value indicating whether the [Preview Mode] icon will be displayed.
StripAbsoluteImagesPaths
Gets or sets the value indicating whether RadEditor should make the absolute images paths relative.
StripAbsoluteAnchorPaths
Gets or sets the value indicating whether RadEditor should make the absolute anchor paths relative.
StripFormattingOnPaste
Gets or sets the value indicating how the editor should clear the HTML formatting when the user pastes data into the content area.
ToolbarMode
Gets or sets the value indicating how the editor toolbar will be rendered and will act on the client
ToolsHeight
Gets or sets the height of the RadEditor toolbar.
ToolsWidth
Gets or sets the width of the RadEditor toolbar.
UseClassicDialogs
Gets or sets the value indicating whether the RadEditor will use RadWindow windows or popup windows for its toolbars and dialogs.
OnClientLoad
Gets or sets the name of the client-side function which will be executed after the RadEditor is loaded.
OnClientCommandExecuting
Gets or sets the name of the client-side function which will be executed before a command is processed.
OnClientCommandExecuted
Gets or sets the name of the client-side function which will be executed after a command is processed.
OnClientModeChange
Gets or sets the name of the client-side function which will be executed before the RadEditor mode (Design, Html, Preview) is changed.
ToolsFile ~/controls/RadControls/
Editor/ToolsFile.xml
Specifies the relative path to the XML file defining the toolbar appearance.
Use "~/" (tilde) as a substitution of the web-application root directory.
You may also provide this property with a valid URL which returns a valid tools file (e.g. http://www.mycompany.com/MyToolsFile.aspx or http://www.mycompany.com/MyToolsFile.xml).
You could also provide a relative path to an aspx file which generates and outputs a valid ToolsFile XML structure.
For example: ~/MyToolsFile.aspx
ImagesPaths N/A Specifies images paths where the RadEditor will look for images.
FlashPaths N/A Specifies flash paths where the RadEditor will look for flash files.
MediaPaths N/A Specifies media paths where the RadEditor will look for media files.
MediaFilters N/A Specifies media files filters.
DocumentsPaths N/A Specifies documents paths where the RadEditor will look for documents files.
DocumentsFilters N/A Specifies documents files filters.
TemplatePaths N/A Specifies the paths where RadEditor will look for predefined template files.
TemplateFilters N/A Specifies template file filters.
ImagesFilters N/A Specifies images files filters.
MaxImageSize 204800 Specifies the max size in bytes of the image files that the user has access to upload.
MaxFlashSize 102400 Specifies the max size in bytes of the flash files that the user has access to upload.
MaxMediaSize 5242880 Specifies the max size in bytes of the media files that the user has access to upload.
MaxDocumentSize 512000 Specifies the max size in bytes of the documents files that the user has access to upload.
MaxTemplateSize 204800 Specifies the max size in bytes of the template files that the user has access to upload.
Language en-US Specifies the localization (language) to be used in RadEditor.
ConfigFile N/A Specifies the Configuration File to be used. This property accepts the special token *PortalRoot*, which stands for the current portal root folder. For example if the current portal is 0, ConfigFile="*PortalRoot*/config.xml" will load "~/Portals/0/config.xml"
CssClasses N/A Additional CssClasses to use with the editor. Comma separated list.
ToolsFileHost N/A The tools file to use for the SuperUser accounts.
ToolsFileAdmin N/A The tools file to use for the Portal Administrators accounts.
ToolsFileRegistered N/A The tools file to use for the registered users.
ToolsFileGuest N/A The tools file to use for the guests
EnableUpload True Enable or disable the upload of content.
EnableUploadUserFolders False Each user will be able to upload to a separate folder (e.g. /Portals/0/images/admin, /Portals/0/images/Larry).
enableXHTML True Enable or disable the XHTML output of the editor. If disabled the output will be normal HTML.
AutoCreatePaths False Attempt to automatically create the paths, specified in ImagesPaths, DocumentsPaths etc. if they don't exist.
CopyContentToClipboard False If set to true, when the update link is clicked, the editor will copy its content into the clipboard. Useful if some error occurs on postback since the content is saved and can be pasted again.
LinksUseTabNames True If set to true, the links dropdown in the editor will insert portal links using the page name instead of the page ID. This is useful if you export/import the portal later and some pages change their ID in the process.
SyncDBOnSubmit False If set to true, the editor will call the "Synchronize Database and Filesystem" DNN function after you submit its content. This is inteded to solve a problem where uploaded images are not shown correctly after you update the editor content.
RadSpellTypeName N/A Sets the fully qualified RadSpell type name, including the assembly name, version, culture, public key token. This property should be set when radspell.dll has been deployed in the Global Assembly Cache (GAC).

Here is an example configuration:
...
< htmlEditor defaultProvider ="RadHtmlEditorProvider">
  < providers >
   <
clear />
<
add name ="RadHtmlEditorProvider"
type ="Telerik.DNN.Providers.RadHtmlEditorProvider, Telerik.DNN.Providers.RadHtmlEditorProvider"
providerPath ="~\Providers\HtmlEditorProviders\RadHtmlEditorProvider\"
AutoCreatePaths ="true"
ImagesPaths ="*PortalRoot*" />
...

Configuring the image, documents, flash, media, and template paths


RadHtmlEditorProvider does not have a separate property to specify where content could be uploaded. It uses the DotNetNuke core functions to verify whether a user has write permissions to a specific folder. So in effect you only need to include an "ImagesPaths" property. The provider will decide to which paths from the list the user can upload.
The other difference from a normal editor is the "*PortalRoot*" path. It specifies the root folder of the portal, from which the editor is opened.

DotNetNuke keeps the folder and file structure of a portal in its database. When you manually copy content to your portal folder, the database and the folder get out of sync. Normally after you change the folder structure of your portal, you should go to Admin>File Manager and click the Synchronize Database And File System link. This will insert information about the new folders in the database and ensure that RadEditor will be working correctly. An exception "Directory already exists." will be thrown if you try to use the editor when the database and file system are not synchronized.

Example:

If you set ImagesPaths="images, *PortalRoot*", the user will be able to select images from "DotNetNuke/Portals/0/" and "DotNetNuke/Portals/0/images/", where "DotNetNuke" is the root folder of your DotNetNuke project.

Configuring the Tools files

RadHtmlEditorProvider supports multiple Tools files, depending on the type of editor user. The supported types are: Host, Admin, Registered User, and Guest. You can specify a different tools file for each of these user roles with the properties ToolsFileHost, ToolsFileAdmin, ToolsFileRegistered, and ToolsFileGuest. Each time an admin uses the editor, the tools will be loaded from the file, specified in ToolsFileAdmin. If the property is has no value, then the tools file for the user with more privileges will be used(in this case ToolsFileHost). Of course you can just set the value of the ToolsFile property and have a single tools file for all users.

Language Configuration

RadHtmlEditorProvider will automatically try to load the localization for the default language of the DotNetNuke portal. If the localization files for this language (both for the editor and spellchecker) are not installed, the provider will default to en-US (English). You can override the default portal language by including the parameter Language in your provider configuration. For example:
1. Default portal language is de-DE (German) - the editor will use German localization and spellchecking will be done in German too
2. Default portal language is de-DE (German) but you have set Language to en-US - the editor will use English localization and spellchecking

Known Issues

  • Images in the default DNN portal: Images on the "Home" page in the default DNN portal are linked only with their name (e.g. <img src="/Portals/0/picture.gif">). If you try to edit these Text/Html modules, the editor will display a broken link because it does not know where the portal root is. Deleting the broken images and including them again with the image manager solves this problem.

  • The default Text/HTML module settings for Width and Height override the ones set in the Web.config file. The following from EditHtml.ascx(located in ~/DesktopModules/HTML/ ) shows the hardcoded values. Line 6:
    <dnn:texteditor id="teContent" runat="server" height="400" width="660"></dnn:texteditor>
    If you wish to be able to set the height and width properties of RadEditor then you should remove the height and width properties from the above declaration.

  • If you experience problems with child portals, for example people getting logged out when saving content, please remove the XHTML validator module from the editor tools file, since it is not compatible with DNN's friendly URL mechanism. The line to be removed is:
    <module name="RadEditorXhtmlValidator" dockingZone="Module" enabled="true" visible="true" dockable="true" />

  • Child portals cannot use the custom links, generated with the editor by default. If you want to use the custom links feature in a child portal please set LinksUseTabNames="false".

  • If you decide to put RadControls as a vitrual directory so you don't have to copy it physically to the DNN installation, remember to add it under the "controls" folder, NOT the root DNN folder. If you add RadControls in the root DNN folder (~/RadControls/), you will experience problems with the editor dialogs. Use the ~/controls/RadControls/ folder instead.


 Print