Follow @Lusse3 (136 followers)

Flickr Recent Photos

Laddning inför knatteliganKräftskivan i full rulle :-)Inför Kräftskiva :-)Ett av många äpplen från vårt äppelträd :-)Fika dags :-)Liams första fotbollsmatch. :-)Liams första tunnelbana åk. Självklart smockfullt. :-)Otrolig trevlig kväll med @plingplongen och hanna. Fast här ser vi lite seriösa ut. :-)Glömt att lägga upp bild på våran fina framsida. :-)Liam kör och ilia övervakar. :-)SoooommarMums!! Arkham expansion. :-)

Categories

FindPagesWithCriteria with PropertyCriteria and PropertyDataType.Boolean set to false

Huge title but pretty much what this post is about.

To optimize your FindPagesWithCriteria, it’s good to be as specific as you can. i.e not use one criteria, get 500 hits back and then just use the top 5 out of those. Anyway, when using a PropertyDataType.Boolean and you want to get back those pages [...]

How to modify and publish a page programmatically in EPiServer

When you want to alter a page programmatically you need to use EPiServers CreateWriteableClone on the working page. This is because the Page itself is readonly. Now, there’s plenty of info out there how to do this, but just to refresh your mind, here’s some code:

PageData clone = pd.CreateWritableClone();
clone.Property["MyProperty"] = "New value";
DataFactory.Instance.Save(clone, SaveAction.Publish);

Simple enough, right?

Now, [...]

Using FindPagesWithCriteria with CustomProperties

FindPagesWithCriteria is a very handy way to pick up pages that are spread out around your site but there’s a tiny thing that is good to remember when using FindPagesWithCriteria to find pages based on a CustomProperites that you’ve made. Never ever forget to click “searchable property”  when you add the customproperty to your page. [...]

How to prevent EPiServer to inherit categories to childrenpages

One of the pages I’ve been working on uses EPiServers categories a lot. But the annoying part with EPiServers categories is the way they inherit down to all children, which leads to the problem that categories can be deleted without someone meaning too. e.g you create a page called “Books” and you have a control [...]

HTML5 fix for Internet Explorer And Doctype fix for EPiServer solutions

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 [...]

Sidan är inte tillgänglig för aktuellt språk / This page is not available for the active language – EPiServer5 Upgrade to SP2

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 [...]

Visual Studio 2008 System.Runtime.InteropServices.COMException

I had to make a clean Vista install on my machine and all of a sudden I was getting System.Runtime.InteropServices.COMException when opening old solutions. The error says very little to the user but what it really want’s to say is:

Install IIS 6 WMI Compatibility by going to Control Panel, Programs, Turn windows features on and [...]

EPiServer CMS5 Softlinks. How to find a documents linking pages

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 [...]

* % & : Special Characters in URL and files causing HTTP 400 Bad Request

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 [...]

SQL converting datetime to shortdate

I’ve a table where I need to select the posts with the latest date. Problem is that when you get the latest date it also gets it by the hour, meaning that it will try to fetch everything older or equal to the date + time, which is nothing. There for, I need to make [...]