Compsoft Flexible Specialists

Compsoft plc

PBA Project Weblog Compsoft Website News Archive Privacy Policy Contact Us  

Wednesday, September 27, 2006

DotNetNuke Custom Controls: A Summary

These are the major bespoke developments undertaken for this project

List Control

A list of text with undo controls. Allows the user to have a list of items containing HTML code or just plain text. The list control also supports tiling; you can specify the number of panels and the list will dynamically tile the results.

Navigation Menu
Navigation menu with a number of configuration options for use in any part of the site. Features include:
  • Layout support: Horizontal, Vertical
  • Tree Level support: Which items should be shown from the current page
    • Siblings; all the pages at that level will be shown.
    • Parents & Siblings; show the parents and all the pages at that level.
    • Children; show any child pages for the current page.
    • Root; all the root pages (i.e. top level pages)
  • Show hidden items; some pages you may want to hide from some menus and not others; i.e. news articles so that they don't appear on the main menu but do appear on the sub menu down the left.
  • Highlight Active Page
  • Different Root Page Support; sometimes you may need to show menu items on another part of the page tree. This property allows you to set what the current page context is when the control loads
News List
This list works by displaying text content that is stored on child pages. This is implemented in the news section where we needed a front cover to the news articles. This control takes the content of the cover text in the child page and displays it in a list.

Next & Previous
A simple control that shows next and previous arrows to allow users to navigation sibling pages. It will automatically hide when you reach the last page, same when you are on the first page.

Search Results
We needed to customise the standard search results control as it did not show a message when no results were returned. This control is completely standard otherwise.

Site Map
This control will produce a list of all the pages in the site. It will show all hidden items so news articles etc will appear on the site map.

Text With Undo
This is the standard text control extended to support rollback. It also has a feature for switching into Plain Text mode which will disable any HTML parsing.

Thursday, September 07, 2006

Fighting with Google API's and IE

Using the google API's on the 'contact us' page we ran into a big problem when view using IE. Everytime you visited the page it would come up with "Operation Aborted" and then not display the page at all.

After some research I found a blog by Ryan Grant describing the problem and a few solutions. Result!

Small snag however, due to the way that DNN structures its pages, none of these solutions would work out of the box. With some quick thinking and a helpful function in DNN (AddBodyOnloadEventHandler ) I managed to get the page to load correctly.

Monday, September 04, 2006

Cosmetics (last - but certainly not least)


It's frustrating with such a project that the cosmetic elements are usually the last to be completed. Whilst they're probably the strongest definition of completeness, the cosmetics are also the least intrusive parts of the development.

Still, it's coming along nicely - great job guys.

Friday, August 25, 2006

Progress Meeting 25/08/2006

Present

PBA: Project Team

Compsoft: Robin Churcher, Neil Bostrom, Henry Carter, Mark Tillison

Outstanding Actions
  • The Searching facilities in DNN are not good, although they may be improved in the latest released version (version 4.3.4). This needs investigation
  • Other suggestions regarding searching include use of Google or Windows Indexing Service.
  • After some initial investigation is seems that DNN does not support any appropriate site map controls. Alternatives will be investigated
  • Contact us form currently has an issue with the JavaScript. HJC to look at fixing the JavaScript.
Issues Discussed
  • Discussed the use of an IFrame to link to careers section of the existing website
  • Styling issues were raised regarding Sectors & Services, Breadcrumb control and links
  • During a discussion on the top and bottom links changing, it was decided that two new panes will be created for top and the bottom
  • Frontpage news ticker requires rewrite as it does not currently support multiple sections showing on the front
  • Image strip to be tested to support images without any padding around. New control that does not produce divs will be used
  • Create portal demo will be tested and corrected for next weeks meeting
  • Change control names to prefix with PBA to allow users to spot custom controls easily
  • PBA to provide an agenda for a demonstration/training.
Next progress meeting: Friday 1st September 2006.

Monday, August 21, 2006

Copy Controls Feature

When I created the custom Text (With Undo) control, I assumed it would work exactly the same as the standard text control.

When testing the control, all seemed well until it came to copying a page. I found that it was not possible to copy the content of the control. After some research, I found that the control had to support IPortable interface . This allows the control to be exported and imported.

One interface later the copy function was up and running.

Friday, August 18, 2006

Progress Meeting 18/08/06

Present

PBA: Project Team

Compsoft: Robin Churcher, Neil Bostrom, Henry Carter

Outstanding Actions from previous meeting (11th Aug)
  • The Searching facilities in DNN are not good although they may be improved in the latest released version (version 4.3.4). This needs investigation.
  • Other suggestions regarding searching include use of Google or Windows Indexing Service.
  • The LOGIN option to the content management side was discussed and it was decided that it should only be visible under certain circumstances. PBA will discuss these circumstances and notify Compsoft
Actions
  • HJC will be focussing on styling for the coming week.
  • Visibility of login control was discussed. After some debate, it was settled (a neat solution - but not one I'm going to make public!).
  • New menu system almost complete. 90% was demonstrated.
  • After some initial investigation is seems that DNN does not support any appropriate site map controls. Alternatives will be investigated
  • Compsoft will update the test system on Wednesdays (@ 17:00). This will be a regular occurrence.
  • 'Contact us' form currently has an issue with the JavaScript. HJC to look at fixing the JavaScript.
  • Time to be spent at next meeting showing the editing features to allow Leon to start the training guide.
Next progress meeting: 25th August 2006.

Tuesday, August 15, 2006

Generics: awesome (until you use enums)

Right, first up I think I should make it very clear that Generics in .NET 2.0 rock seriously hard. However, I feel in the intrests of developer awareness I should post this slight problem I found while writing a generic method a few days ago.

Basically, I was trying to write a method which could be called to get module settings from a database. I thought it would be a good idea to have one method that just picked up the setting. In this case, it was always coming from XML and so was a string when initially returned. It then returned it to me in the correct format.

Here's what I came up with initially:
Public Shared Function GetTabModuleSetting(Of T)(ByVal settings As Hashtable, ByVal key As String, ByVal DefaultValue As T) As T
Dim o As Object = settings(key)
Dim retValue As T = DefaultValue
If o IsNot Nothing Then
Try
retValue = Convert.ChangeType(o, GetType(T))
Catch ex As Exception
retValue = DefaultValue
End Try
End If
Return retValue
End Function
Pretty simple and works so long as the representation of the setting is convertable however enums return as their numeric values which is then in turn held in a string when returned to my function which will therefore not happily convert to a return type of Enum.

The way I got round this is shown below:
Try
' If we are trying to return an enum then we have to work differently
If GetType(T).IsSubclassOf(GetType([Enum])) Then
retValue = Convert.ChangeType([Enum].Parse(GetType(T), [Enum].GetName(GetType(T), CType(o, Integer))), GetType(T))
Else
retValue = Convert.ChangeType(o, GetType(T))
End If
Catch ex As Exception
retValue = DefaultValue
End Try
This basically parses the enum correctly having initially converted the string representation of the numeric value into an integer. Not a pretty work around but a necessary one in order to make the function truely generic so as to include Enums in it's repertoire.