Archive for the ‘Web development’ Category

A webmasters’ time and resources are limited

Webmasters’, IA’s and other computer power users are continuously facing the reality of scarce resources and little time to manage them.
It is as if people who work with computers are the culprit of “the active users’ paradox”.
If you don’t know what this paradox is, have a look at Bokardo’s post on the subject but it basically comes down to the following:

The “paradox of the active user” is a paradox because users would save time in the long term by taking some initial time to optimize the system and learn more about it.

Paradox of the Active User (Alertbox Sidebar)

If I have a job to do, let’s say create a content inventory, I could go through the website, create the sitemap and content inventory by hand or …
I could learn a bit more about vbscript, excel and visio and create both in one go.

If I automate, I save time. In this case, I can make a better decision on which pages I really have to read. I don’t have to go through each and every page.

There are probably a thousand example like this:

  • corporate system admins writing scripts to install PC’s,
  • batch files to connect to shared drives,
  • managers trying to cramp everything in an excel file and run vbscript reports on the figures,
  • me trying to create a script that generates an Umbraco website package from my excel content inventory, which I can import (Anybody? please mail me :-)

Either you do it manually, or you study and automate.

I tend to go for the latter, but that is because I prefer to do new things instead of struggling through the routine of doing something over and over again.
If I calculate the time spent, I end up with the same amount or even more time spent.

Just make sure that this job is not the first or last time you have to do this and in the end you will be spending less time doing routine jobs.

CSS, Personas and IA blogs

Old posts are supposed to be a good way to keep the interest level up for your blog. And I did find some articles which I completely forgot about, so this is a good time to bring them back to your attention.

I managed to go back to November 2003 and reviewed an article I wrote back then about CSS as a debugging tool for templates. This is a little theoretical, but three years later I wrote an article on how to implement this technique:


Personas is another topic which I touched several times and you can still download a tool to help you create personas:


And to finish, you should have a look at all the articles my European colleagues managed to write during my absence. Only one of the blogs mentioned in the article is no longer available, which IMHO, is quite an achievement on their part.

Performing loops in XSLT

If you read this blog from time to time, you might have noticed that I am often talking about the XML/XSLT combo. Some people really don’t like declarative programming languages, because it is well, declarative. It works for me though.

(http://en.wikipedia.org/wiki/Declarative_programming). (Dimitre Novatchev actually proved [PDF 400kb] that XSLT can be used as a functional programming language)

One of the problems with XSLT is looping. To create a loop, you have to be able to update the same variable over and over again until you reach the desired value for that variable.
But XSLt doesn’t do that. if you declare a variable it will hold the same value untill the end. this bit really puzzles alot of people, but wait there is a solution.

You can get around almost any problem because most of the XSLT processors available, allow you to extend your XSLT stylesheet with JSCript, C# or whatever compiler is available on your system. But it is a bit messy.

If you start using this kind of combination of JavaScript and XSLT, your code gets unreadable very soon. So that is the reason why Oliver Becker created this nice loop extension. He uses nothing but XSLT that can be used as any other XSLT Extension. Have a look at the code below how it’s done:

<loop:for name="i" from="10" to="1" step="-1">
 <loop:for name="j" from="1" to="10">
  <xsl:value-of select="$i * $j" />
   <xsl:text>&#x9;</xsl:text>
  </loop:for>
 <xsl:text>&#xA;</xsl:text>
</loop:for>

He implemented for loop AND while loops.

<loop:while test="expression">
 <!-- optional some <xsl:variable> elements -->
  <loop:do>
   <!-- template body -->
    </loop:do>
    <loop:last>
   <!-- template body -->
  </loop:last>
 <!-- at least one <loop:update> element -->
</loop:while>

And a “function” to just update a variable:

<loop:update name="qname" select="expression" />

Have a look at the other XSLT stylesheets he is offering for download on his homepage:

  • Merging XML documents
  • Tracing execution of a stylehseet
  • Quine: The Self-Reproducing Stylesheet

In search for Google

Yahoo and MSN made minor tweaks to their interface. One of them seems like a reaction to how people use search boxes.

If you search for the phrase “google.com” on one of these search engines, they will give you a second search box, similar to the one on top giving you a second try to use their search page.


What is going on here?

People buy package PCs and internet connection deals that involve changing the homepage to the preferred search engine of the dealer you bought it from. When people finally get the internet connection working, they start IE and type “google.com” in whatever box they can get their hands on. It has been known for a while that people use other search engines like that.

The strange thing though is that they did not notice the address bar and the similarity of the address in there and what they just typed.

Why not type “google.com” in the address bar?

I guess that people don’t know the difference between the browser interface and the webpage that is rendered by the browser.
The changes in the interface of these result pages, Yahoo and MSN, are most probable driven by real case studies, so you should be aware that:

  • changing browser interface elements like the scroll bar will obfuscate the difference between browser and webpage even more
  • people don’t know what an address bar is
  • people don’t know what a URL is used for
  • people know how a URL looks like
  • people know what a link is
  • people know what a textbox is and a button to search

The visitor on your site might be the same person that uses Yahoo as a bookmark to go to google.com.

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:

Quality control with style sheets

Once you are off with a CMS and people start to edit pages, all sorts of code grows inside the database. Copy-paste leftovers from MS Word and code handwritten by tech enthusiast clutter your clean and simple HTML template and after 2 weeks your design is no longer what it used to be.

Sounds familiar?

To avoid all these problems we can use a well-known CSS combo: dependency and specificity, to mark all these little coding errors with big borders in orange or red, depending on the severity. Editors really don’t like these boxes and will do whatever it takes to get them out.
To see how it works you need a human editor with HTML3 and <FONT> tag knowledge, a CMS that can detect if an editor is logged on (any CMS does that), and the stylesheet we are going to create.

Editors in charge

You or a designer crafted the headers very carefully, and they really look great in the new design. Pixel-perfect!
Unfortunately the editor in charge thinks that headers should be bigger and bolder. He looks at the design and goes into the CMS to make same basic changes, adding FONT, B and any other element he knows about. This is additional markup that can mess up your entire website and really shound’t be in there.

There is actually not much you can do about it if you stick to using a rich text editor (RTE) and don’t want to break down the document into distinct fields (and validate these fields). But… you can make people aware of these things. And I will show you can do this using a few lines of code and a stylesheet.

Let’s have a look at an example stylesheet:

/* stylesheet headers */
h1 {	}
h2{
	font-size: 1.05em /* not too big */
	font-weight: normal; /* instead of bold */ }
h3 {	}

What happens if the editor incorrectly adds a <FONT> tag, and a B element?


What happens here? If you are unlucky, the rest of the page is rendered with the wrong font-size and your headers appear bold.

To avoid all these things you can work your way through all the little errors and add them into the additional stylesheet like this:

/* stylesheet debug */
font, b, i{
	display: block; /* make it stand out on the page*/
	border:2px solid red; /* here is your problem !! */
	font-size: 8px; /* very small unreadable print*/
} 

h2 strong {
	font-weight: normal;
	display: block; /* make it stand out on the page*/
	border:2px solid orange; /* orange means: not nice, but is ok */
}  

Don’t want DIV elements inside the #content area, because they should use paragraph element?

#content div {
	display: block; /* make it stand out on the page*/
	border:2px solid red; /* here is your problem !! */
	font-size: 8px; /* very small unreadable print*/
}

These are simple examples but they show how the idea works. Once you know your template and what can happen when things go wrong, you can dig a little deeper and apply strict rules to where an element can and is allowed to appear.

For example, I have seen some editors use BLOCKQUOTE to indent paragraphs. This is a common mistake and will not be allowed, so I added this to the rules:

.productpage #content blockquote{ /* error markup in here */ } 

I am not allowing BLOCKQUOTE elements in the content block on a productpage. (note: You need to be able to distinguish different page types from each other).

When should you show these errors?

Obviously, we shouldn’t show these errors to the visitors. That is where the need to detect the login comes in. ALl you have to do is test if the person viewing the website is logged in as an author and based on that test, add the debug stylesheet or not.

This is the XSLT code I am using in Umbraco:

<?xml version="1.0"?>
	<xsl:stylesheet version="1.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:msxml="urn:schemas-microsoft-com:xslt"
		xmlns:umbraco.library="urn:umbraco.library"
		exclude-result-prefixes="msxml umbraco.library">
	<xsl:output method="html"/> 

	<xsl:param name="currentPage"/> 

	<xsl:template match="/">
		<xsl:if test="umbraco.library:RequestCookies('UserContext') != ''">
			<link media="all" href="/css/debug.css" id="debug" rel="stylesheet" type="text/css"/>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>

This is an XSLT macro, using the default Umbraco library to detect the cookie with the authentication flag. If it is found and not empty, add the debug stylesheet in the HTML header of the page.

The next step is to determine if you are going show the errors in a life environment to make sure editors have to care about it, or that you will leave it out and only use it for your quality review.

I always show the big errors and surround them with a red border. Using font tags to override my CSS rules is unacceptable so these will be shown in the life environment.

All you have to do is split the severe errors from the others and put them in a separate sylesheet. Then hardcode the reference to the stylesheet into the template. That way the severe errors will always be shown and editors will have to check their pages in preview mode before actually publishing.

I am not sure if this technique is useful for other webmasters, but if you do plan to use, let me know.

I am currently using it on my Umbraco installation and in the beginning it cause a lot of support because the editors will call you. After a while they will know and they have learned to use standard based markup. After that support calls will go down again.

Google Calendar

Eindelijk is het zover, de Google calendar is in beta gegaan. Ik heb nog niet de tijd gehad om het grondig te bekijken maar ik weet wel dat er al een andere kalender op het net beschikbaar is: Airset.

Airset laat je toe om je contacten te importeren vanuit Outlook en dat werkt zonder problemen. Ook de organisatie van contact groepen in de tabs is volledige open, zodat je verschillende groepen kan aanmaken.

Airset Calendar application

In Google Calendar maak je een nieuwe kalender aan in plaats van een groep. Daarmee legt Airset de nadruk op je contact gegevens die je kan linken aan een groep, zoals je vrienden, collega’s of klanten.

Google Calendar

Google Calendar ziet er fantastisch uit, en de meeste zaken werken zoals je het verwacht, althans zoals ik het verwacht. Ik ben een Outlook gebruiker en misschien loopt dat niet helemaal snor als je met Lotus Notes werkt.

Het grote verschil met Airset is dat Airset een volledige waaier van functie heeft geïntegreerd, zoals email, SMS, maar ook een persoonlijk blog, importeren van je contacten, todo lists en een link sectie. Daarmee concurreren ze natuurlijk met Google die al die applicaties apart draait maar niet volledig integreert. Je kan geen contacten uit Gmail gebruiken om een vergadering te plannen in Google Calendar of Google Pages gebruiken om een woordje uitleg te geven over een vergadering.

Wat ik wel leuk vind aan Google Calendar is de mogelijkheid om allerlei feestdagen toe te voegen. Zo kan je de katholieke feesten toevoegen maar ook de islamitische of zelfs Vietnamese. Leuk als je in een internationale omgeving werkt of je vrienden aan de ander kant van de wereld zitten. En de mogelijkheid om met de “Quick Add” button een afspraak in te voegen: Afspraak 1pm tomorrow, en dat het dan de afspraak ook nog op de volgende dag zet om 1 uur ’s middags.

Google calendar werkt toch dat ietsje sneller en vlotter en het ziet er fantastisch uit.

Video interview met Jacob Nielsen

Op de MS site devsource.com is er een video gepubliceerd waarin Jacob Nielsen geinterviewd wordt. Het beoogde publiek zijn developers, coders, real IT/Dev kerels.

Jacob ziet er echt uit als een verstrooide professor: net uit de strip van Jommeke gesprongen.

Het interview geeft wel een beter inzicht in een aantal publicaties van Jacob en hij herhaalt verschillende elementen die je steeds terug vind in zijn Alertbox.

  • Developers zijn niet de users. En dat is iets dat je overal terug vind. En ik vrees dat de meeste usability specialisten/webmasters/Ias/… dat ook niet zijn.
  • Dus, voor een test heb je een echte user nodig. Geen fancy lab met eyetracking, gewoon een tafel, papier en pen, een luisterend oor.
  • De interviewer vraagt om enkele goed en slecht websites aan te halen. De eerst die hij aanhaalt is Yahoo. Groot bedrijf, veel inzicht in users, focus op de users en noden.
    De tweede website die hij vermeld is die van Victorias Secret. Volgens Jacob een website waar je schoenen kan kopen. :-) Wel …, vreemde schoenen naar mijn mening, maar ik kon effe niet meer van het lachen.
  • Dan krijgen we een uitleg over PDF. Dit interview verduidelijkt zijn standpunt over PDF als print medium. PDF werkt niet in een online omgeving waar “paging” en controle over de lay-out van een document weinig of geen betekenis heeft. PDF is niet slecht, PDF is goed om af te drukken.
  • De volgende stap is natuurlijk dat search niet werkt wanneer je gigantische pdf documenten online zet. Als je een zoek term invoert ben je op zoek naar iets specifiek en heb je geen zin om te wachten en die 500 Mb PDf handleiding te downloaden. Search is inderdaad een onderschatte tool voor de meeste website. De meeste gratis search engines kan je dan ook beter verwijderen van je website. Als je de search engine niet kan aanpassen aan de noden van je website en van je gebuikers kan je de search feature beter achterwege laten.

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