Cross-CMS Development. Possible or Not?

The Problem

Web 2.0 has changed Internet. This is true fact. Moreover, Web 2.0 is still changing Internet. Dozens of new CMS appear each year. Some of them are successful (and even commercially successful). Some of them are not. Some of them are technology-aware, others are user-centric. Each CMS does the same job as others: controls web site. But each CMS has its own user community, its own extensions/modules repository etc. because each CMS requires its own programming language (framework, technique? etc.). So what we have thinking about overall CMS world efficiency? Is it good or bad to have many incompatible CMS? The answer is: Good and Bad.

  • Good because the programming platform itself is a big treasure of each CMS. It let reusing many of features, samples and documentation. Moreover, platform’s user community is a good place of getting help if CMS itself has no strong user community.
  • Bad because we have no common way to develop modules for different CMS.So, it would be great if we have an intermediate layer allowing single standards development for any CMS.

The Solution

Here I must say that we already have a cross-technology programming platform that can be found on any hardware and in any programming language – XSLT. XSLT is a good starting point for the generalized platform:

  • XSLT is extensible pretty much. One can provide custom functions to reach better integration with executing environment.
  • XSLT is a rich programming model. It has conditions, loops, subroutines and allows to be split into a series of modules/files.
  • XSLT is XML so it can be easily parsed and preprocessed allowing non-macros to be used XSLT is very fast (in many languages it has a “compiled” form)
  • XSLT is a good template engine as it generates output as is without any print, write, etc. operators.

So, the idea is to provide a simple module for each CMS that will be capable of the following:

  • Executing XSLT
  • Editing XSLT in admin mode
  • Providing database access as XSLT extensions
  • Providing CMS / Web server environment access as XSLT extensions
  • Web page submission, AJAX helpers, State management, etc.

And also packaging application that is capable to put ting XSL and SQL scripts together and creating installation/upgrade package.


Of course, this approach is not for creating complex applications with thousands man-days budgets and years of development. But if you need something simple to be built easy and fast – XSLT-based development environment is right tool. I think that the following tasks can be easily implemented using XSLT:

  • Integration with external services. With new platform we can easily read data from external source process or save them into database. We can easily create a handler url that can accept parameters and process them or just put to database. For example, you will be able to integrate with payments processors, real estate catalogues, hotels/ticket reservation systems etc.
  • Custom views. You can easily create custom views for modules if they can do it exactly as you want. If you have some ordinary module (articles, news, classifieds, etc.) and want to send it to browser in your own special way – just write XSL, query database and generate HTML. Nothing new here but you use the same universal simplified syntax in any CMS!
  • AJAX controls data source providers. There are many AJAX frameworks that require data in form of JSON, XML etc. You can easily create a parameterized URL handler or AJAX function that query database and return data in required format.
  • Simple modules as feedback forms, chats, polls etc. that do not require deep CMS engine integration.

Great, I like it. What to do now?

Anyone willing to take part in development of cross-CMS programming environment is welcome at AnyCMS project: Just join project or leave a message in forum if you are interested in cross-CMS features.

| Leave a comment

Formatting Google News

Google provides news with images, titles, descriptions, etc. in form of RSS. But news descriptions go with ugly HTML and bunch of links that you probably do not want to see on your site.

XsltDb is a good tool to analyse XML returned by Google and transform it in clean readable news column on you site. In case of simple homepage you even can avoid putting news in database and keep it in ASP.NET cache that simplifies development and decrease traffic.

| Leave a comment

Creating links with click counter

I know many cases when you need to create a smart or say rich link on a page. Rich links are links that can first execute some logics and than send user to desired location. What kind of logics can be implemented here:

  • Count clicks, provide extended statistics;
  • Hide actual URL;
  • Determine actual URL after user clicked the link.

There are 2 main methods of providing such links

  • Javascript page submission
  • Redirect link (like Linkclick.aspx)

I have created a new tutorial on the XsltDb Project site that shows how to create rich links using XsltDb.

Posted in DotNetNuke, XsltDb | Leave a comment

AJAX. Javascript Function, XML Service

If you have found a pretty good javascript control that requires data to be loaded from server asynchronously – XsltDb is something you’d appreciate. It provides a very simple way to load data asynchronously by javascript function or by providing a URL.

Here I provide an example of loading list of Modules currently installed in DotNetNuke.

1. Creating javascript function

The first method covers full cycle of AJAX. XsltDb helps creating javascript function that goes to the server (using XmlHttpRequest) queries database, returns data to client and call a user-defined callback. This is an XsltDb configuration that creates such a function:

<mdo:callable js="getModules(filter)">
   <xsl:copy-of select="mdo:sql('
       select * from {databaseOwner}[{objectQualifier}desktopModules]
       where FriendlyName like @filter
   ', 'module', '@filter', concat('%', mdo:request(filter), '%'))" />

The code is pretty short, isn’t it?

Attention! As we use free sql statement we must check the Super Module option above XSLT Editor.

Resulting output on HTML page is a javascript function getModules that returns a list of modules as XML string. You can use XSL to create any type of output: string, JSON, etc. Usage of the getModules is simple:


getModules("x", function(result){

Or synchronous (not recommended)


2. Creating a URL handler

Controls often capable of querying a URL that return XML data. This is also easy to implement with XsltDb. Create a new module, click Edit XSLT and fill “Alias” field above the control with “modules” alias name. You also must check Super Module option tobe able to execute SQL.

<xsl:if test=" mdo:request('service')='modules' ">
   <xsl:copy-of select="mdo:sql('
       select * from {databaseOwner}[{objectQualifier}desktopModules]
       where FriendlyName like @filter
  ', 'module', '@filter', concat('%', mdo:request(filter), '%'))" />

xsl:if is not nesessary and used to prevent output generation when we open a page where the module sits.

The URL that returns data provided by the module is:


In our case we must use


Example would be:

      url: '/DesktopModules/XsltDb/ws.aspx?service=modules&filter=x',
      success: function(data, status, http) {

Note that you can put all your services on a separate page and reuse it from any page of your site or from other sites.

More about AJAX in XsltDb:

Posted in DotNetNuke, XsltDb | 2 Comments

Show a DotNetNuke Module In a Telerik Window

Live Demo:

As I have shown in many tutorial XsltDb is a good tool to use with Telerik Controls. Now I going to demonstrate how to use XsltDb to put a DotNetNuke module in a Telerik RadWindow.

The process is simple:

  1. Put the module you want to wrap into a window on the page,
  2. Under (important) the module put a new XsltDb module.

XsltDb script is following:

<xsl:text disable-output-escaping="yes"><![CDATA[
<%@ Register
   Assembly="Telerik.Web.UI" %>

<mdo:asp xmlns:asp="asp" xmlns:telerik="telerik">
  <telerik:RadWindow ID="wnd" runat="server">
      <div id="content-placeholder" />
<script type="text/javascript">
  function showWindow()

<a href="javascript:showWindow()">Show Window</a>

Two lines in code above are bolded, I must clarify what they are exactly for:

  • First, we declare a RadWindow with a div placeholder inside. We put our module into the div.
  • Second, we create a script block where we find module to move and move it’s content to the placeholder inside the RadWindow.

Look at magic red 441 number. This is an ID of module to move into a window. Unfortunately, I don’t know a reliable method to extract complete module HTML. But I noticed that DNN inserts a <a name=”<ModuleID>” /> above a module. Module ID can be captured from URL when we edit module settings as …/mid/441/…

By default window is hidden. You can either create a link or button to show the window or setup a RadWindow property VisibleOnPageLoad=”true”.

Live Demo:

Additional information about XsltDb:

Posted in DotNetNuke, XsltDb | 2 Comments

DotNetNuke Menu Localization

If you are building a multilingual site you can use DotNetNuke localization interfaces to translate names, field labels etc. But what about your main menu? If you have in English

Home | Services | Products | Contacts

you may want to see these captions in other language also (Russian for me).

Главная | Услуги | Продукты | Контакты

And this is easy to do without any additional tools. Open the following file


( in my case) And find a position of system menu items, something like this:

<data name="//Admin.String" xml:space="preserve">

Here you can see a tab path and translated name. It is natural to suppose that DotNetNuke doesn’t make difference between system and custom menu items and it really doesn’t!!! You can just create another translations for the Home, Services etc. menu items:

<data name="//Home.String" xml:space="preserve">
<data name="//Services.String" xml:space="preserve">
<data name="//Products.String" xml:space="preserve">
<data name="//Contacts.String" xml:space="preserve">

And DotNetNuke read it immediately!


  • This localization is applied to every portal of your DNN installation
  • Tab paths (e.g. //Products) are case sensitive in resx files

Here is the sample:

Also review XsltDb Localization sample:

Posted in DotNetNuke | 1 Comment

Accessing DotNetNuke Tables

As you know, DotNetNuke Database objects are named with a prefix that you supply during install and also you can setup a specific owner for all tables, stored procedures and other objects. In DotNetNuke you can use macros {databaseOwner} and {objectQualifier} inside SQL query. XsltDb also allow you to do that

mdo:sql('SELECT *
   FROM {databaseOwner}[{objectQualifier}DesktopModules]', 'mod')

see also mdo:sql documentation

If you use a SqlDataSource you can not use those macros. You have to use an mdo:dnn-prepare-sql() function to replace macros:

<xsl:variable name="sql">
   SELECT ModuleName, FriendlyName, Description
   FROM {databaseOwner}[{objectQualifier}DesktopModules]
   ConnectionString="&lt;%$ ConnectionStrings:SiteSqlServer %&gt;"

See also SqlDataSource sample

Posted in XsltDb | Tagged , , | Leave a comment