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