Extending Umbraco with a library

I have been using the .net based Umbraco CMS for more then a year now and never have I had the feeling it limited me in anyway. But now I need a quick and dirty approach to connect to a database other then the Umbraco database.

Umbraco can grab XML feeds using the build in XSLT library extension, but I am just playing around at the moment and need direct access to manipulating query results.

So I created my own XSLT library. It has one 1 method at the moment: QueryDatabase(‘connection string’,'query’)

Just a note: it probably is not the greatest idea to use this in a production environment. What I plan to do afterwards, is to hard-code the query into another method not allowing any unknown request to the database.

But here is the code anyway (code pasted below), the dll and the VS 2003 project zip file.

If you want to use it without looking at the code just do the following actions:

  1. Download the astuanax xslt libarary dll
  2. Unzip the file and put it in the “/bin” folder of your Umbraco website
  3. Edit the file “xsltExtensions.xml” in the folder “/config” and
  4. Add the following line:
  5. Once you got this running, go to the XSLT editor in Umbraco and paste the following code into your xslt file:

    This will show you the XML code you can expect from this query.

Leave a comment if you like it. Or if you have a problem using it, let me know and I will try to fix it.

C# Code:

Filed under: Article, English, Web development, XSLT — Tags: , , , , — Len @ 10:34 am

Sorry, comments for this entry are closed at this time.

Categories

About

My name is Len Dierickx and this is my personal blog. I studied Musicology at the UG, long time ago but got more and more into webdevelopment. I started this blog because the EuroIA summit in Brussels (Belgium, Oct 2005), was such an inspiration. And I was thinking about a blog on IA a while now, so that was the extra kick I needed to get it actually done.

Powered by WordPress