Some helpfull EPiServer 7.5 code snippets

Since a couple of weeks when I started with EPiServer I experimented a lot. Here is a quick summary of some code fragments that I found on the internet that can be very usefull in some cases. I am not going into detail about these code fragments because honestly I dont understand all of it (yet).

Creating a page that can be used as a block in a contentarea

Sometimes you want a page that can also be dragged in a contentarea and should display differently when inside such contentarea.

In this example I have a product page that can be dragged into the contentarea of the webshop page. When you drag it into the contentarea the pages partial view is rendered.

In this example I have a product page that can be dragged into the contentarea of the webshop page. When you drag it into the contentarea the pages partial view is rendered.

The same page also exists as a ‘real’ page. But it looks (renders) differently when viewed as a ‘real’ page:

When you open the page itself it renders a different view

When you open the page itself it renders a different view

The accomplish this behaviour we need to create two controllers, one for each rendering type.

Leave a Comment.