Googlewave invites arrive to those who wait, just like a Christmas gift 😛 But on a serious note. When you have a googlewave account, you eventually get a few invites to give away. I still have 10 to give away so just add a comment here (with your email ofc) and I’ll be sending one your way.

Goolewave to the people! Viva Google! 😛

HTML 5 introduces new elements to use such as <header> <section> <nav> and many more. The problem is that no version of Internet Explorer recognizes the new elements, but Firefox, chrome and many others does. The solution is easy but a bit boring when you think about it, since it’s about replacing all new elements to div instead. Which means that IE users won’t be able to appreciate HTML5 but users that use Firefox, Chrome and so on will.

Anyway, on with the solution! What you need to do is modify the writer and basically find all elements and change them with a div.  A good place to do it on is on your masterpage.

protected override void Render(HtmlTextWriter writer)
{
if(Request.Browser.Browser == "IE")
HTML5Replace(writer);
else
base.Render(writer);
}

private void HTML5Replace(HtmlTextWriter writer)
{
MemoryStream memoryStream = new MemoryStream();
StreamWriter streamWriter = new StreamWriter(memoryStream);
HtmlTextWriter memoryWriter = new HtmlTextWriter(streamWriter);
base.Render(memoryWriter);
memoryWriter.Flush();
memoryStream.Position = 0;
TextReader reader = new StreamReader(memoryStream);
string output = reader.ReadToEnd();
output = Regex.Replace(output, RegExStrings.HTML5_BLOCK_ELEMENTS , RegExStrings.HTML5_BLOCK_ELEMENTS_REPLACEMENT );
writer.Write(output);
}

But what REALLY does the magic is the RegEx, since it will find the elements for you and replace them correctly.

public const string HTML5_BLOCK_ELEMENTS = @"<(\/)?(nav|section|header|aside|footer)";
public const string HTML5_BLOCK_ELEMENTS_REPLACEMENT = @"<$1div";

The reason why I use $1 on the replacement string, is because I want to add a ”/” if there is one in the element I found. This to close the tag correctly. So basically, when it finds ”<nav” it will replace it with ”<div” and when it finds ”</nav” it will replace it with ”</div”. Closing tag and class/id names will still be there so the div can take on the behavior of the replaced element.

Another problem that you will run into, if you’re running your site with EPiServer that is, is that EPiServers friendlyurlrewriter doesn’t recognize the doctype and it will try to fix it for you. For HTML 5 you’ll need the following doctype  ”<!DOCTYPE html>” but EPiServer will change it to the following ”<!DOCTYPE HTML PUBLIC ”” ””>”. Mohsen Pirouzfar found a great solution for this which you can read here. It’s in swedish but the code itself is usable to anyone 🙂

We’ve had huge problems with the testserver. It first felt like a cache problem, because when you updated the content and hit refresh several times, you saw the changes and then you didn’t. Also, pages that were dependant on session state were giving null expressions since the state was empty sometimes.

The problem was in the Application Pool. DefaultAppPool was for some odd reason by default set to 3 worker processes which makes it a web garden (used for load-balancing) and this caused the user to get the errors mentioned above, since only one of the worker process actually had a valid session, the others didn’t.

worker

After upgrading EPiServer CMS5 r2 to CMS5 r2sp2 you might get a nice little error in edit mode. This page is not available for the active language. This is due globalization changes and the workaround is to activate a language for your site. To do this do the following:

1. Go to admin mode
2. Click on Config
3. Go to systemsettings
4. Activate Globalization
5. Go to Edit mode
6. click on Language Settings
7. Chose the default language
8. Go back to admin mode
9. Turn off globalization

This should do the trick. Remeber, if you have several sites, you need to click on the root of each one of them and set the language settings on all of them.

I’ve been working with VMWare running WinXP for a year now but now it’s feeling a bit too slow so I’ve decided to run vista native on my macbook pro.  (will upgrade to vista7 later on).

First problem was that Boot Camp assistant couldn’t create a partition for windows since it couldn’t move some of the files. The ”best” solution seems to be to run time machine and recover. That way it will defrag the harddrive and let you create the partition.

Second problem was the drivers. I’ve installed Vista SP2 and boot camp2.0 didn’t really work as intended. Neither the trackpad nor fn button was working properly, so I had to install 2.1 as soon as possible. Problem is that the installation just pops up and nothing happens.

I’ve runned into two solutions for this problem.

One:

Try the following:

1) run: regedit.exe

2) search for: Boot Camp Services
the key should be: ProductName

3) change in the same path, the Language key to: 1033

4) run the installer again

I didn’t really try this one out at though but most people say it works.

Second way:

Change your region to English(US)
Uninstall Boot camp 2.0
Restart
Install Boot camp 2.0
Restart
Install Boot camp 2.1

Yes, it’s annoying. Yes, it takes time. But now it’s done and finally I’m running Boot camp 2.1. (restarting as I’m typing this). Just hope that trackpad and fn key will work now 😛

Using EPiServers softlink can really come in handy in different situations.  Mostly of course when you need to gather information from the linked pages of a document.

Here’s an example on how to use this:

Example in VB.Net


Dim f As EPiServer.Web.Hosting.UnifiedFile = TryCast(System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile(filename), EPiServer.Web.Hosting.UnifiedFile)

Dim filecollection As EPiServer.DataAbstraction.SoftLinkCollection = EPiServer.DataAbstraction.SoftLink.Load(f)

For Each file As EPiServer.DataAbstraction.SoftLink In filecollection
Dim ref As New PageReference
ref = file.OwnerPageLink
'now you can work your magic
Next

Example in C#:


EPiServer.Web.Hosting.UnifiedFile f = System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile(filename) as EPiServer.Web.Hosting.UnifiedFile;

EPiServer.DataAbstraction.SoftLinkCollection filecollection = EPiServer.DataAbstraction.SoftLink.Load(f);

foreach (EPiServer.DataAbstraction.SoftLink file in filecollection) {
PageReference ref = new PageReference();
ref = file.OwnerPageLink;
//now you can work your magic
}

So what you need to do is pretty much to load up the file reference into a softlink and fill a softlinkcollection with that. Then just run a for each on the collection (since a document can have several linking pages). Once you get your reference, you can just do a getpage on the ref and grab whatever you need from the linking page.

One of our customers found a little annoying bug when publishing news to their page.

The bug goes as following:

News page type contains a few categories as well as an extra date field to point out the news date (in case you don’t want to use the publishing date and want to use your own) and it’s required as well.

You forget to fill out the news date,  but fill everything else up, including choosing which categories the news should belong too and then hit Save and Publish.

EPiServer will do a postback and warn you about not filling in the news date. If you at this moment check the categories, you’ll see that they are still clicked in, you fill in the date and hit save and publish once more.

The news will be posted but without the categories as EPiServer will lose the values on the postback but still show them as checked.

This is a verified bug from EPiServer and hopefully to be fixed in an upcoming version.

NBC and youtube aint best friends, that’s no suprise. After Youtube posted some NBC videos they deleted their youtube channels and you will find it hard to find any NBC videos on youtube. Quite a shame since its free commercial for NBC but that’s not the point with this post.

Have you watch ”Dick in a box”? if not, then click here and go watch it first. Justin and Adam went and made a second video and this one is as funny as it gets 🙂 Only problem is that it’s quite hard to find a watchable video since NBC is killing it on youtube and their site requires you to be a US citizen. But Sevenload has saved the day. So enjoy!

Link: Mother Lover Justin Timberlake-Saturday Night Live

One of our customers have a lot of PDF that are linked to their site. Some of these PDF files have % in the filename and this causes a HTTP 400 Bad Request and yes they are encoded correctly. The same error happened with other characters such &, * and :

Finally, the solution was found @ dirk.net with an article regarding 400 bad request in IIS7 (But IIS6 also has the same problem and the solution will work there too). You can read about it here.