Using JQuery with DotNetNuke 4.x

I’m currently doing a project using DotNetNuke, and we’re using JQuery plugins to achieve certain content rotation and scroller functionality.  All was ‘amost’ good as I’d found a way to inject the JQuery script to the page header on a per-skin basis, but in ‘edit’ mode the actions button wasn’t showing up at the top of containers in FireFox and was causing JavaScript errors in IE.

I’d already gone through the hoops of declaring jQuery.noConflict(), but it still appeared to be conflicting with the dnn:actions (solpartactions) control.  I’d read somewhere else about Solpart code being incompatible with JQuery.

I tried one last thing, adding the noConflict() call in the JQuery library script file itself – rather than running as a fragment on page load.  This fixed everything, as something else was obviously getting in and hijacking in the meantime.  Apparently with V5 this will all be fixed as JQuery’s more integrated with the framework.  Anyway, for those interested here’s what I had to do to get JQuery (and associated plugins) talking nicely whilst still allowing the actions menu to pop up on my containers…

  1. Amend the JQuery library (jquery.1.x.x.min.js) by adding the following line at the bottom…

    jQuery.noConflict();

  2. Amend the skin you want to load the jquery library (and plugins) in (we’ve got it only in specific skins to avoid the overhead where it’s not required).  You could also do this in the module by checking ‘if loaded’, but here’s the code for a skin (in ascx file)…

    <script runat=”server”>
        Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            ‘add a script reference for Javascript to the head section
            AddScript(“/js/jquery.scrollable-1.0.2.min.js”)
            AddScript(“/js/jquery.mousewheel.js”)
            AddScript(“/js/jquery-1.3.2.min.js”)
        End Sub
       
        Private Sub AddScript(ByVal fileName As String)
            Dim oLink As New HtmlGenericControl(“script”)
            oLink.Attributes(“language”) = “javascript”
            oLink.Attributes(“type”) = “text/javascript”
            oLink.Attributes(“src”) = fileName
            Dim oCSS As Control = Me.Page.FindControl(“CSS”)
            If Not oCSS Is Nothing Then
                oCSS.Controls.AddAt(0, oLink)
            End If
        End Sub
    </script>

    The order is important, as we’re adding the scripts to the ‘top’ of the scripts each time.  JQuery needs to be the first referenced.

  3. Make sure that anywhere you use jQuery you use the jQuery(xx) syntax, and not $(xx).

That’s it.

ASP.NET Open Source Content Management Systems – The Winner

Well, it’s been a little while since I first talked about Content Management Systems, but I can declare that


mojoPortal is the one for me.


There’s a number of reasons, but I’ll go through the main pro’s than means it wins out over DotNetNuke



  1. It’s XHtml compliant out of the box, and has minimal use of tables.  All the people producing skins for MojoPortal are also well evolved along the accessibility curve too.

  2. It uses standard .NET features.  This is due in no small part I’m sure to the fact that it started after DNN and more facilities were around in ASP.NET at the time.  This means that Skins, Themes, Master pages are all present and correct with MojoPortal, rather than the proprietary (but well documented) skins in DNN.

  3. It seems to be quick(er than DNN)

  4. The facilities are stable and work very nicely.  There are less modules, but the developer video tutorials are a really good way to get yourself into developing your own modules and edit pages.

  5. You can get involved and work with the code – after downloading from SVN (I fixed a small bug and felt really good about it!)

  6. Finally – and this is an easy clincher – the support for the product is just fantastic.  Joe Audette is like a man possessed on the forums, and you’re likely to get a really well thought out answer to any query within a few hours (depending on the time zone!).  He’s sorted me out on a few occasions and set me along the righteous path. 

In summary, mojoPortal is something I’m happy to be using for a client as I’m more keen to use standard .NET features than proprietary skinning.  I also like the philosophy more of the development community, and how Joe Audette’s running the project

ASP.NET Open Source Content Management Systems

I’m producing a site for a client at the moment, and it quickly became apparent that I’d have a number requirements that would lead me down the CMS path:



  1. Client makes direct updates to the site (with approval/preview possibilities if possible)
  2. Built-in membership, security, roles etc (why write this yourself? – I’ve got 2 kids and just don’t have the time or inclination!)
  3. Skinning capability (OK ASP.NET gives you that ‘kindof’ for free – but I throw it in anyway)
  4. CSS-driven layout (rather than tables) – This is a technical requirement for me rather than the client, but I want to make the site accessible and SEO-friendly
  5. Capability to customise  and add generic hooks to other office-based systems
  6. Quick time to market (building all the above from scratch would be ‘fun’ I’m sure, but would also take time)

To be fair to the customer I couldn’t really suggest that I do everything from scratch when there’s plenty of open source and commercial CMS’s that can do the job very well. 


I do .NET – so I’m sure there’s plenty of great CMS’s for other platforms, but I’m not about to use this as a re-skilling exercise, charging a customer for the pleasure (as I need to do some more ‘significant’ development around the site, so will be using .NET for that).


What follows is a personal view based on my requirements and my experience (rather than extensive research into each product).


DotNetNuke


This was the first one I considered as I’d had dealings with it a few years ago (a dev ‘community’ site at a previous employer).  After playing with just about every module on the planet at the time (‘cos you do), we realised we just needed a blog, so converted to Community Server as that seemed a bit less cluttered.  (BTW if you want to run .NET blog without SQL Server (like me) then DasBlog’s what you want.


Pro’s



  • Price (free)
  • Supports pretty much everything I need (open architecture, skinning, module development etc)
  • Familiar from previous use
  • Easy to use and administer – very WYSIWYG
  • Documentation’s comprehensive (if a little focused towards the high-level architectural view). 

Con’s



  • Slow (I thought I imagined this as my own dev machine’s not a ‘beast’ and it’s running SQL 2005 express, but part of this is potentially partly due to the caching mechanism (as noted on the MojoPortal site)
  • Table-driven by default (if you want your skin to be CSS-driven you’ve either got to muck around for ages finding a ‘good’ CSS skin (there’s plenty of bad/really basic ones).  This extends to the DNN standard controls, and it takes an awfully long time (using Firebug and the IE Dev toolbar) to work out why you’ve still got fixed size fonts when you’ve gone to great length in your skin to make everything sizable.  (I’m sure again the better CSS skins address this, but you there always appears to be something that gets in the way because the original DD design uses tabular layout throughout).
  • It’s written in VB.NET (OK this isn’t a ‘real’ reason, as there’s no difference – I know!  You also shouldn’t need to do much (if anything) in VB.NET if you’re a C#’er and you want to extend things – I think I’m just a bit miffed I’ve got to work with a bit of VB.NET at work at the moment 🙂 )
  • Not that keen on the actual logical structure, and the limited url-rewriting.  The whole anonymous tab thing out of the box.  It seems to me that DNN was designed before lots of newer features became available and it’s had to bolt them on as time’s gone by.
  • Lastly – it doesn’t feel very open source.  It’s clear that the business model has evolved to keep the output freely available whilst making money out of books, consulting and conferences (fair play to Shaun Walker – he deserves the kudos for the product).  I just feel that things went a little ‘corporate’ a while ago, which turned me off.  I bought an iRiver rather than an iPod for the same reason (too much marketing noise that turned me off, almost trying to bombard you so you don’t even consider other products, and also trying to deter competition).  There’s also many people now trying to make money out of skins (most of which aren’t terribly good) – another indicator that the ‘community’ isn’t very focused on open source development.

MojoPortal


Until a couple of days ago I’d not heard of this, but the performance discussion (above) sparked my interest.  It’s clearly got less out-of-the-box functionality and community support than DNN and is lacking more in the documentation department, but if you’re after a no fuss implementation then this might be the way to go.


Pro’s (from the site – not my experience)



  • Free and open source
  • Multi DB support (just about any DB you’d care to use)
  • Approval/workflow support (although haven’t looked into this yet)
  • Provides major functionality required
  • Skinning uses standard ASP.NET theme-based approach
  • Aligned relatively well with accessibility guidelines (CSS layout) – XHTML compliancy 

Con’s



  • Download is actually a little confusing.  You’ve got a number of zip files and you’re left to work out which one/s you need.  I downloaded a couple then reaslied I only needed the mssql release. 
  • Documentation a little lacking (although installation pretty easy once you’ve just changed a config setting). 
  • More of a ‘developer’ product – some understanding of .NET required.  This makes it more difficult for non-techy people to get it off the ground  

Jury’s still out on this one as I’ve literally installed and that’s it.  I need to get to grips with the integration and skinning support, as I want to change the default 3 pane layout and remove the left panel, so we’ll see how that goes…


Others (That I don’t know anything about)


Rainbow Portal (looks like it might be more worth a look in a year or two when there’s a bit more support


Umbraco (not all versions free)


 


So what am I going to do now?  Install MojoPortal and see if it ‘feels’ nicer than DotNetNuke.  I’m not really too worried about future support, and upgrades as I’m providing a site to a client who will run with it once I’m done (based on what it does ‘now’ – and how stable it is ‘now’).


I’ll post the results – or add to the list when I’ve come to a conclusion after some more research