Archive for EPiServer:
So you got the
Could not find a part of the path error when your EPiServer website is looking for Shell\ClientResources\packages.config?
This should be easily resolved:
- In episerverFramework.config, make sure that your app data base path is correct:
<appData basePath="\\SERVER\EPiServer\VPP\ProjectName" />
- In your website root, check the
modules folder. In the _protected\Shell\ folder, make sure you've got the EPiServer.Shell.UI.zip file. If you don't have it, install a new EPiServer website and copy the zip file from that one. Remember to not mix EPiServer versions too much here.
Hopefully any of these solutions makes it work!
Recently I got an error message working with EPiServer, StructureMap and a WCF service:
StructureMap Exception Code: 202\nNo Default Instance defined for PluginFamily
It turns out I forgot some StructureMap configuration. Adding this configuration solved the problem:
This is just a friendly reminder - when using EPiServer VPP, don't forget to specify maxVersions for each virtual path in episerver.config. By default, maxVersions is set to 5 for Documents, but nothing else.
One often forgotten feature of EPiServer VPP's is the actual versioning of files. It might be handy at times, but it's also handy remembering its drawbacks.
There might be a scenario where you have a scheduled job creating a large page structure and saving a lot of files for every page. Now imagine this job runs a couple of times every day - after a while you'll eventually run out of disk space.
(Of course you can probably write a file comparer to make sure the same file isn't uploaded multiple times.)
Make sure to specify maxVersions for Global Files, Documents and Page Files to be in complete control. More often than not, 2-3 versions are enough, rather than an infinite amount of versions ;-)
Recently we migrated an EPiServer 5 website to CMS 6 R2. Most things went well, except Page Files stopped working - we couldn't browse to any document in page files despite the VPP being there. After some research, the conclusion was that the
<location> element for page files was missing in Web.Config.
Just search for <location path="Documents"> or <location path="Global"> in Web.Config and add this section for Page Files before:
<add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true" />
<add path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" validate="true" />
<staticFile expirationTime="-1.0:0:0" />
<add name="webresources" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
<add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" />
EPiServer XForms is a pretty sweet alternative when it's up and running. However, implementing XForms is not always the simplest thing. Here are some reminders and pointers to get your XForms ready faster:
First of all, take a look at the Public Templates implementation of XForms. Then:
- Copy XForms.ascx + cs files to your project.
- Copy the XForms specific events from global.asax.cs to your project's global.asax.cs.
- Make sure your SMTP settings are correct. If they aren't, there will be no redirect after the XForm is posted, and therefore no thank you message will be displayed.
Particularly the XFormAfterSubmitPostedData event (global.asax.cs) is interesting. Obviously it decides what happens after a form is posted.
Here is a helpful post on XFormAfterSubmitPostedData and SMTP settings.
Every once in a while you might want to sort your EPiServer categories. First thing that comes to mind is that the order in which the categories appear in admin mode, is the order by which the categories are sorted when displaying them. Actually, it's not always that way!
EPiServer categories seems to have no built-in sorting when retrieving them as a list when using CategoryList.
Luckily, each and one of the specific categories do have a SortOrder property which is really useful.
You can use that SortOrder property and the generic SortedList class to sort the categories, like this:
SortedList<int, ListItem> sortedCategories = new SortedList<int, ListItem>();
CategoryList cats = CurrentPage.Category;
foreach (int c in cats)
Category cat = Category.Find(c);
string catName = Category.Find(cats.GetCategoryName(c)).Name;
ListItem li = new ListItem(catName, catName);
Peter Sunna is one of those guys you wish you always had in your team - he’s really talented and possesses great knowledge in many different areas. He also happens to work at EPiServer, where he contributes to make stuff easier for all involved in the product. I had the chance to meet up with Peter during a lunch to talk about EPiServer, general development and career stuff, plus much more.
Enjoy the great guy that is Peter Sunna!
So, what's happening at the EPiServer headquarter right now?
I've been with EPiServer for one and a half year now and it really feels like the development is going in the right direction - and EPiServer 6 is coming soon too! There has been a lot of collaboration with developers regarding the platform. I and my colleague Mats Hellström has been a part of it, which feels good.
How does it feel to be back in Stockholm city? What do you have to say about your new office?
I've got only nice words for our new office! I promised myself at our earlier office in Akalla that I would never complain on an office located in the center of Stockholm, so I've got nothing negative to say about this office - it's positive in all possible ways!
I commute by bike and it takes 20 minutes, just like it did when I worked at H&H once upon a time. This also means my working days are 9 hours now instead of maybe 11 hours when we were at Akalla.
Can you tell, what exactly do you do at work? What is your mission at EPiServer?
My official title is Sales Engineer, but I work in three different areas at EPiServer:
Pre-sales, where I'm involved in sales pitches and propose technical solutions in new end-client projects, plus inspire our partner developers.
Next part is education, which means I teach in a number of courses each year, which is good as it keeps you updated on the product. You also meet developers and get to know the existing problems.
The third part is expert services, which means we contribute with expert knowledge if partners need help with for instance a large scale website or if a code review is needed. We're there to help if partners really need help, you can say it's like an extended support.
What does the sales responsibility mean for you?
The most important thing is to get partner developers interested in the product. That's probably our most important sales channel. Me and Mats (Hellström) focus very much at the developers, we run tech road shows, where we visit partners and show new products and cool demos. We've also got EPiServer Tech Forum, which is quite popular - we run it in Stockholm, Gothenburg and Malmo in Sweden. The EPiServer sales network is growing and there is usable knowledge around which we benefit from.
Then we also have more traditional sales where you are on the field with a sales man and maybe meet an end client where you propose a technical solution. This often happens during the concept stage in a web project, so you propose a high level solution and then it's up to the EPiServer partner to put the solution into practice.
An example: two connected EPiServer websites with a SharePoint integration.
I've got a free role and now that social media has grown so much we of course use those channels as well, which is great fun.
What would you say is the best thing about work?
The best is I get to communicate with developers and discuss technical problems and solutions. Plus, of course, I get to influence EPiServer!
Top 3 features you want in EPiServer CMS 6?
I already know what will come in the next version, but I've got two wishes and one feature I know will be built in:
I'm an ambassador for ASP.NET MVC and hope it'll grow to become a larger part of EPiServer, even though it won't be a big part in version 6 (except for the new site center).
Together with MVC, unit testing comes more natural. You can already do unit testing in EPiServer with Joel Abrahamsson's EPiAbstractions, but I want better support for it built into the framework.
A new editor comes in version 6 - tinyMCE. tinyMCE finally gives us support for browsers that follow the web standards, which is really, really good.
You're a bit more web standards aware than the traditional .NET developer - why is that?
It's actually a bit boring to confess, but it was quite random that I did start to work for Funka.nu (in Swedish) in 2004 and they focused very much at accessibility.
During my five years at the university, I never came in contact with accessibility, which is really scary - but when I came to Funka as a developer, you had to develop websites using web standards and make them accessible. It was absolutely a new world that opened to me and I haven't looked back since.
What do you think is required to get developers to focus more at web standards, accessibility and usability?
I think this change has already begun, due to many reasons. If you look at usability, many companies have employed seven system developers and no interaction designer, but this has changed a lot and I believe the iPhone is a part of this. When iPhone came there were many people wondering why their products didn't work as seamless and easy as in the ones in the iPhone. The drawback with accessibility is it cannot give the same wow feeling if no one has a disability.
What you can do, for instance, is to let a developer browse the web without a mouse, to gain accessibility understanding. Next step is to communicate what you can do to develop accessible websites.
It's often quite easy, it's just about building in the right way and if you've done it once, you'll always to continue do so. One of the largest problems with accessibility is that it seems too complex - W3C has failed in that area. One example is a document regarding heading levels which might be three pages I read through - and still don't understand what I've read - and that's a problem.
How did you start your developer career?
My father was a computer science teacher and thanks to this we had a huge laptop, which had MS DOS 5.1 on it. He also taught in Pascal and programming, which is the reason I began with development.
When I was going to the university, the logical choice was to study computer science, but afterwards I think it was a rushed decision because already during upper secondary school I had read a lot about programming. None the less, that's the way it went.
My first public project was a four in a row game you could play online or against the computer. The name was Fyrad (English translation: Shot) and a bit later the successor came, Fyrad 32, which was written about in the at that time large news letter named Lockergnome.
What would you say is your best career move so far?
It's hard to single out a specific move. But if I have to say it, it's when I gave notice to my job at Umea University and moved to Stockholm in the middle of a recession without a job. Safety isn't always the best option.
Any career advice you can give a developer?
My advice is to setup a goal for yourself - what do you want to achieve? Do you want to deepen further into development or broaden your skills into other areas? It's also important to be a part of the community and share what you've done.
Do you have a particular project you're especially proud of?
During my time at the university I and two friends started a company where we focused on web publishing. Everything started out with our football team that needed a new website, which meant I wrote a website in C++, not very common but it was a programming language I knew. This was a website which managed statistics, top scorer charts and league tables.
I built the next version of this website in Perl and Xml because I realized C++ wasn't the best to use for the web. This version became so good that we decided to build our company around it and our largest customer in Umea, BiljettCenter, had this system for maybe seven years!
How's it going with the discgolf then?
It's gone really bad with discgolf this year, which is a bit boring. The thing is, when I was 20 years I decided to start playing golf after my football career hit an end, but it took too much time so I started with discgolf instead and played very, very much.
We're five friends from Umea who now live in Stockholm and we play discgolf at least one a week at Järva-fältet outside Stockholm. It's a social activity, the important thing is to hang around and have fun.
Discgolf isn't that huge in Sweden but those who play it are very enthusiastical. It's a bit of an outsider sport and if I compare to golf it's a much nice feeling to play discgolf.
Are you still a Chelsea fan?
I've never really been a huge Chelsea fan, but I started to support them when everybody else supported Manchester United, Liverpool and Tottenham.
Do you enjoy any other sports than discgolf and football?
I like to play floor ball, squash and more. When I was younger I had a passion for ice hockey and Bjorkloven Sweden - I was probably their largest fan during junior high school.
I spend less time watching sports though, to the benefit of my girlfriend and other nice stuff.
How do you most like to spend your spare time?
Discgolf or any ball sport isn't wrong. I like to hang out with my girlfriend Anette and why not go skiing in the Alps?
Golf vs tennis?
Best lunch meal?
A healthy meal.
Best summer vacation?
Car trip in Romania, it's fantastic!
Latest thing you shopped?
Best town in USA?
Seattle, because the whole west coast mentality appeals to me, it's like Europe. They are also very aware of the environment.
This environment thing, is it something that interest you?
I want to be more involved than I actually am, but sometimes I pretend to be more interested than I am. I'm contributing to Greenpeace and often try to put focus at the environment in discussions.
I also try to be a part of what's happening.
One example: because I'm from Norrland in northern Sweden, I didn't want the rivers destroyed by water power. Both wind power and water power is environment friendly but destroys the surroundings we none the less live in.
3 persons to follow on Twitter?
It's hard to point out three persons because the whole Twitter thing is you get input from a lot of different persons. There are persons I like one day but hate the next day when they post irrelevant stuff. But my three are:
Your favourite websites?
In 30 years time, what do you want to have achieved in life?
I want to have been a part of a project where you've contributed to a better environment. It sounds like a cliché but it would be fantastic to be a part of!
What inspires you?
Beautiful nature is the greatest source of inspiration. It's fantastic to hike in the mountains (northern Sweden). To stand by the Tornea river fishing graylings a late august evening - that's inspiration!
Any final words?
Thanks for the interview! Keep up the good work.
I recently stumbled upon a problem in EPiServer CMS 5, where no subscription e-mails were sent out - even though users had subscribed to changes for specific pages. Together with the excellent Ted Nyberg, the problem was localized and solved. Here's a post on the case plus some reference material regarding the subscription handling in EPiServer CMS 5.
First of all, the Subscription class in EPiServer is located in the EPiServer.Personalization namespace. You can find details on the subscription class in the EPiServer SDK: Subscription class
For a visitor to be able to subscribe to a page, the property EPSUBSCRIBE must be present on the page type used for the specific page.
Here's a basic example on how to subscribe a user to a page:
The SubscribeTo method automatically pics up the current user's profile and subscribes the user to the specific page.
Subscribing to a specific language version
What went wrong with the website was that there was no specification of what language version of a page a user had subscribed to.
How it came down to this one can only speculate about, but the website was migrated from EPiServer 4.11 to the latest EPiServer CMS 5 release, a huge step which might have contributed to the confusion.
To be able to narrow the problem down though, we had to take a look at two tables in the EPiServer database: aspnet_Profile and tblLanguageBranch.
- aspnet_Profile contains the profiles on the website
- tblLanguageBranch contains details on the languages available on the website
In this case, the website was a one language website.
The aspnet_Profile table
What we had to do was to first identify any user with subscription problems in the aspnet_Profile table. The easiest way to identify a specific user and find the user in the aspnet_Profile table, is to run a query on the table aspnet_Users, like this:
SELECT UserId FROM aspnet_Users WHERE UserName ='martin.soderlund';
Then you'll get the UserId, which you can use on the aspnet_Profile table, where you'll want the PropertyValuesString column’s value:
SELECT PropertyValuesString FROM aspnet_Profile WHERE UserId='[USERID]';
The PropertyValuesString column contains XML data, where the SubscriptionInfo element is of special importance. It looks like this (when subscription works as expected):
<?xml version="1.0" encoding="utf-16"?>
<SubscriptionInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
Pretty much is actually obvious – information on subscribed pages for a user is stored, together with page language settings, e-mail intervals and an e-mail address to the user at the end.
What I and Ted discovered though was that the Languages element was empty - meaning no subscription e-mails were sent out for the specified language – in this case the default and only existing language.
In comes the tblLanguageBranch table, plus a language parameter for the SubscribeTo method.
The tblLanguageBranch table
To be absolutely sure about which language prefix was used on the website, we just opened the tblLanguageBranch table and realized the language id was a mis-match in regard to what was used for pages users were subscribed to.
Here's how the tblLanguageBranch table might look:
What we did, was to also add an existing language string parameter to the subscription code, in this case the fkBranchLanguageId value, "en":
Subscription.SubscribeTo(new PageReference(7), "en");
When this was done, we knew subscriptions would work. However – there was one small thing left – an EPiServer oddity.
Know how subscription works for a specific page
When you want a specific page's update to be sent out via subscription e-mail, you have to meet some requirements first:
- You'll need to tick the Mark page as changed checkbox
- The subscription scheduled job must be able to run
- You'll need to make sure the user is subscribed to the parent page
Particularly the last requirement is worth taking a note on, since a subscription to a page doesn't do what's first expected.
If you update a page ticking the Mark page as changed option, a subscription mail won't be sent out for the page's update - but for its child pages, if the Mark page as changed option is ticked.
Also, it's good to know there's a possibility to choose how often subscription e-mails should be sent, through the Interval property. Make sure you know the interval when testing!
Summary on subscriptions
To be able to send subscription e-mails, make sure the following is in place:
- You add a language parameter in the SubscribeTo method
- The same language actually exists in the tblLanguageBranch table
- You meet the requirements for page subscriptions
If you anytime bump into the problem with XHTML code which isn't interpreted correctly in EPiServer, you might want to take a look at what EPiServer property type contains the XHTML code.
If you use the common Long string property type, the XHTML will be treated as HTML and the code will be shown in uppercase, thus not validating.
Instead, you should use the XHTML string property type.
If you've got any problems, just change the property type to XHTML string (<255) and your problems will probably be solved.