How to format code blocks in DotNetNuke 6

by Goran Siric on Monday, September 26, 2011 4:21 AM

Well, this is blog about development. Right? So in my posts I need to write some code, so I started to google how to format code blocks in DNN 6. There is a good article about that and you can find it here: Formatting Code Blocks in DotNetNuke 6

Article is pretty straightforward:

You need to log to site as SuperAdmin  and start HTML Editor Manager from the Host menu.  Then you need to select Toolbar configuration tab.  You will get displayed XML file with configuration of the Editor toolbar. In the  sections you need to add following XML to get FormatCodeBlock toolbar available in the toolbar of  the HTML Editor:

<tool name="FormatCodeBlock"/>

Here begins the Nightmare. I tried to start HTML Editor Manager and  have displayed nice red rectangle with message inside: "Object reference not set to instance of object", or something like that. What to do now ? I am new to DNN. How to found reason of this error ? First what I tried is to change web.config section to allow remote users to see errors. That isn't helped. Same rectangle again. After some research I found that I can see all errors using Admin->Event Viewer.  In error logs I found following error:

DotNetNuke.Services.Exceptions.ModuleLoadException: Unhandled Error Adding Module to ContentPane ---> System.UnauthorizedAccessException
Access to the path '...\html\Portals\0\Users\001' is denied.

Why is there access denied ? I remember then. I have installed DNN on GoDaddy servers. GoDaddy does not allow that DNN be installed at root.  I followed some articles and moved  DNN to root folder. Because GoDaddy doesn't allow to set permissions on the root folder and because all subfolders inherit permissions from the root, they all have only read permission enabled.

After I changed permissions to read/write on this folder  HTML Editor Manager was finally started. Then I changed ToolbarConfiguraton and clicked Update.  Loading animation was displayed and nothing happened for few minutes.

I realized that there again must be some problem with permissions. After some research (again) I found that location of toolbar configuration file is "/DesktopModules/Admin/RadEditorProvider/ToolsFile/ToolsFile.xml". After changing perrmissions to read/write on folder DesktopModules everything is working fine.

As you can see, now  I can format some text as code blocks:

if (something_was_wrong)
   //maybe you need to read documentation first
   //code not reachable

Goran Siric

Blog about programming

If you found this useful,
you can buy me a coffe :)

By me a coffe through PayPal :)

Featured articles

AndEngine - Textures tips and tricks

What you should know abot textures before get started programming your first game.

GIMP script for creating Android icons at once

Script for creating Android icons for different screen resolutions at once. Icons can be saved using standard Android icons naming conventions and saved in appropriate folders.

Creating Android button with image and text using relative layout

Source code with examples how to use relative layout to create nice buttons with text and images in Android

Android application and the Internet

Tutorial about connecting to the web pages on the Internet from Android application, using both POST and GET web requests.