Episerver Blocks

Being able to split your page designs into reusable  components that content editors can then manipulate how they want tom is one of Episervers best-selling points,  These components in Episerver language are called ‘Blocks’.  This section describes what blocks are is more details, how to create some and some how-to guides on creating specific blocks that you may want to implement within your project.

How To Manually Render An Episerver Block In Code

This post is another rare case example and, as the usual disclaimer, 99% of the time you will never need to do this.  The information in this article is a working that may be required in exception circumstances.  Situations like custom caching or rendering of content spring to mind.  This should not be used for […]

How To Create a Mega Menu In Episerver

Creating the main navigation is one of the first big tasks on any website build. On the majority of simple websites, a menu can be structured based on the top level hierarchy of the page tree, so image a scenario like: In a classic scenario Page 1, Page 2 and Page 3 would be the […]

How To Return Different Valdation Warnings To Content Editors When Publishing In Episerver

In Episerver 7+ developers have been provided with a handy new feature to provide different levels of feedback to content editors when they create new pages and blocks using the ValidationErrorSeverity enumeration. The ValidationErrorSeverity comes in four flavours: None Info Warning Error Which, when triggered, a dialogue will appear next to the publish button: There […]

How to render all your block variations in preview mode in Episerver

I've talked previously about how to preview blocks in Episerver, How to Preview a Block in Episerver.  In today's tutorial we are going to cover previewing different renderings for your blocks based on all the available display options set on the website. In this advanced tutorial we'll cover a preview model to render all these […]

How to Preview a Block in Episerver

One thing you'll undoubtedly run into when building your first Episerver website, is trying to preview a block. Previewing a page will work as expected, but, when you try to preview a block within a ContentArea in edit mode, you see a 'Preview is not available for this item' error: I've talked previously in How […]

Creating A Multi Language Picker In Episerver

In my previous tutorial I wrote about How to enable multi-languages within your website. Today I'm going to talk to you through how to create a language picker so your website users can swap languages. Determining Languages In your code, you can always get the current language by reading the CultureInfo.CurrentCulture property like you would […]

How To Configure Episerver To Allow Users To Render Blocks At Different Sizes

In Episerver 7.5 and above, a new feature was released that allows content editors to change the widths of blocks and pages partials. In my last article How To Make A Block Use Multiple Views ? A Partial View Controller Explained I briefly covered this topic, but today, I'm going to dig a bit deeper […]

How To Make A Block Use Multiple Views ? A Partial View Controller Explained

One of the main benefits of using MVC is the separation between the view and the model.  This separation means a block or page can have more than one view.  In Episerver we have several methods available to us for rendering views.  In today's article I'm going to go discuss rendering content without a controller. […]

EPiServer Blocks A Quick Reference Guide

Last time I discussed what a page type is, in this article EPiServer Page Types A Quick Reference Guide, today I'll talk about blocks.   A website is made up from a number of different types of pages.  Each of those pages are made up of a number of different components... those components are called Blocks.  […]

How To Create A Breadcrumb in Episerver

In order to create a breadcrumb, you will need to be aware of the GetAncestors method. Get Ancestor will return a list of pages from the users current page in the page tree, back to the start page. A few code examples using GetAncestors: or Moving back to the breadcrumb, we will also need to […]

Episerver 7 : Creating an Episerver Sign-Up Form

I have a requirement to implement a custom log-in block.  As the block could be placed anywhere on the site, data messaging becomes more of a key feature.  How will you render the control on a page, then post back to the page that calls it and trigger any Model State errors. My log-in block […]

Episerver 7 : Creating a custom form block that posts back to a page controller

I have spent many an hour of my life messing around with trying to get information to be passed between different controllers in different states.  A fairly common requirements is having a page that is made up of a form built up via several blocks, for example a three step checkout process, entering in your information, […]