Blog entries tagged with code samples

Create EPiServer Composer functions with Page Type Builder

by: Ted Nyberg (Ted & Gustaf)

In this post we look at how to create Composer functions, such as layout blocks and content blocks, with Page Type Builder. [ Read full article ]

03 September 2011  0 Comments


Create an EPiServer Composer page type with Page Type Builder

by: Ted Nyberg (Ted & Gustaf)

Here we look at how to create a new Composer page type and template using EPiServer Composer 4 and Page Type Builder. [ Read full article ]

03 September 2011  0 Comments


Create new dynamic content in EPiServer

by: Ted Nyberg (Ted & Gustaf)

One way to create more dynamic page templates in EPiServer is to use dynamic content. Here's an example of how to create dynamic content including dynamic content settings. [ Read full article ]

28 September 2010  0 Comments


Unit test an EPiServer 6 website using Visual Studio 2010 and MSTest

by: Ted Nyberg (Ted & Gustaf)

When unit testing it can be tricky being dependent on a web context. In this post we'll look at how to start EPiServer and run it outside of a web application to make unit testing easier. [ Read full article ]

09 August 2010  0 Comments


Loading and saving a custom property value with PropertyUserControlBase

by: Ted Nyberg (Ted & Gustaf)

The PropertyUserControlBase class in Template Foundation has been updated with two new events called PropertyLoad and PropertySave, making it easier to load and save the property value. [ Read full article ]

30 July 2010  0 Comments


Custom properties in EPiServer using user controls

by: Ted Nyberg (Ted & Gustaf)

EPiServer Template Foundation makes it a lot easier to create custom properties based on user controls. In this post we go through the steps needed to create a new custom property in EPiServer and use user controls for rendering the property in ed... [ Read full article ]

25 July 2010  0 Comments


New EPiServer website using Template Foundation

by: Ted Nyberg (Ted & Gustaf)

In this post we'll look at how to set up an EPiServer CMS 6 website from scratch based on EPiServer Template Foundation. [ Read full article ]

19 July 2010  0 Comments


Introduction to EPiServer Template Foundation

by: Ted Nyberg (Ted & Gustaf)

In this post we’ll look at how to include EPiServer Template Foundation in your EPiServer project in order to use the different page type base classes and publish EPiServer pages using Windows Live Writer through the MetaWeblog API. [ Read full article ]

19 July 2010  0 Comments


ClassFactory not initialized exception in InitializableModule

by: Ted Nyberg (Ted & Gustaf)

The new initialization system in EPiServer 6 can be used to execute logic in a specific order on startup. This post explains how to ensure your startup modules are executed after the DataFactory has been initialized properly. [ Read full article ]

01 July 2010  0 Comments


Attach EPiServer event handlers on startup using InitializableModule

by: Ted Nyberg (Ted & Gustaf)

Explanation of the new InitializableModule concept in EPiServer 6 which is used to implement functionality that should execute when an EPiServer site starts, for example to attach event handlers. [ Read full article ]

21 May 2010  0 Comments


Create a new page language branch programmatically in EPiServer

by: Ted Nyberg (Ted & Gustaf)

This article describes how to create a new language branch programmatically for an existing page in EPiServer. [ Read full article ]

21 May 2010  0 Comments


Create a page programmatically in EPiServer

by: Ted Nyberg (Ted & Gustaf)

Code sample demonstrating how to create new EPiServer pages programmatically using the DataFactory class. [ Read full article ]

21 May 2010  0 Comments


Search pages in EPiServer using FindPagesByCriteria

by: Ted Nyberg (Ted & Gustaf)

How to find pages in EPiServer by searching using the FindPagesWithCriteria method. The code sample describes how to search in EPiServer using criterias based on page properties. [ Read full article ]

20 May 2010  0 Comments


Introduction to the PageTypeBuilder project

by: Ted Nyberg (Ted & Gustaf)

An introduction to Joel Abrahamsson's PageTypeBuilder project for EPiServer. Here I go through the basics of defining a strongly typed page type including page type inheritance. [ Read full article ]

08 December 2009  0 Comments


How to set up an EPiServer website

by: Ted Nyberg (Ted & Gustaf)

This post mainly aims to complement Frederik Vig’s posts on setting up a new EPiServer site with some comments and pointer that I find valuable. [ Read full article ]

08 December 2009  0 Comments


Introduction to EPiServer Dynamic Data Store (DDS)

by: Ted Nyberg (Ted & Gustaf)

This post provides an introduction to the Dynamic Data Store, or DDS, which was introduced with EPiServer 6. [ Read full article ]

12 October 2009  0 Comments


Parse an EPiServer XHTML property with Dynamic Content

by: Ted Nyberg (Ted & Gustaf)

Render Dynamic Content without the Property control Outputting EPiServer property values are often done using the EPiServer Property control: < EPiServer:Property PropertyName ="MainBody" runat ="server" /> Using the Property control will render... [ Read full article ]

16 September 2009  0 Comments


Parse an EPiServer XHTML property with Dynamic Content

by: Ted Nyberg (Ted & Gustaf)

This post explains how to parse XHTML which contains dynamic content in EPiServer so that we can retrieve the actual markup. [ Read full article ]

16 September 2009  0 Comments


Managing e-mail subscriptions in EPiServer

by: Ted Nyberg (Ted & Gustaf)

In this post we create an admin plugin for EPiServer which allows administrators to add or remove e-mail subscribers. [ Read full article ]

14 April 2009  0 Comments


Managing e-mail subscriptions in EPiServer

by: Ted Nyberg (Ted & Gustaf)

Background E-mail subscription in EPiServer CMS 5 is based on ASP.NET profiles. Starting and stopping subscriptions through code is easy, but I was missing a plugin where administrators could easily add new subscribers, remove existing subscriptio... [ Read full article ]

14 April 2009  1 Comments


A new EPiServer page link control

by: Ted Nyberg (Ted & Gustaf)

  This post describes how to implement a basic server control which extends the HyperLink control to allow for easy linking to EPiServer pages. Being able to specify the inner text and title of an EPiServer page link If you want to insert a link t... [ Read full article ]

06 April 2009  8 Comments


Implement a stock quote ticker using Silverlight (part 1/3)

by: Ted Nyberg (Ted & Gustaf)

Goal of the implementation In this series of posts I’ll walk you through implementing a Silverlight control for displaying a share ticker on an EPiServer website using dynamic content: Prerequisites In order to complete this sample you need the... [ Read full article ]

30 March 2009  3 Comments


Implement a stock quote ticker using Silverlight (part 2/3)

by: Ted Nyberg (Ted & Gustaf)

This is the second post in a series demonstrating how to retrieve stock quotes from a web service, present them using Microsoft Silverlight, and finally enable EPiServer editors to insert such stock quotes as dynamic content. If you haven’t alread... [ Read full article ]

30 March 2009  1 Comments


Implement a stock quote ticker using Silverlight (part 3/3)

by: Ted Nyberg (Ted & Gustaf)

This is the final post in a series demonstrating how to retrieve stock quotes from a web service, present them using Microsoft Silverlight, and finally enable EPiServer editors to insert such stock quotes as dynamic content. If you haven’t already... [ Read full article ]

30 March 2009  2 Comments


Adding a custom plugin button to unpublish a page in EPiServer

by: Ted Nyberg (Ted & Gustaf)

I was recently in a discussion where the topic of unpublishing pages in EPiServer came up. Fredrik Haglund mentioned that some customers want to have an “ Unpublish ” button, and I agree. Some clients are fine with setting the Stop Publish propert... [ Read full article ]

12 February 2009  16 Comments


Check if a dynamic property has been specified on the current page

by: Ted Nyberg (Ted & Gustaf)

Dynamic properties versus page properties As you probably know, dynamic properties are like page properties in many ways, except they do not need to be set specifically on a per-page basis. Dynamic property values are inherited in the page tree.... [ Read full article ]

03 February 2009  7 Comments


Customize the search experience with Search Server 2008

by: Ted Nyberg (Ted & Gustaf)

I recently posted an article on how to use Search Server 2008 for local searches on a website or intranet . In this post I’ll focus on the search query XML schema used by Search Server 2008 and how to customize search queries by specifying what... [ Read full article ]

23 January 2009  3 Comments


Using EPiServer and Microsoft Search Server 2008

by: Ted Nyberg (Ted & Gustaf)

If you're interested in EPiServer and Microsoft Search Server you may also want to have a look at the post  Customize the search experience with Search Server 2008 . Introduction Microsoft Search Server 2008 is a stand-alone search server built up... [ Read full article ]

20 January 2009  19 Comments


Adding multiple links using the Link Collection property in EPiServer

by: Ted Nyberg (Ted & Gustaf)

Background The LinkItemCollection class was a truly appreciated addition when EPiServer CMS 5 R2 was released. Part of the EPiServer.SpecializedProperties namespace the LinkItemCollection class is a property that editors can use to add multiple... [ Read full article ]

12 December 2008  17 Comments


How to get the internal URL or page reference based on a friendly URL in EPiServer

by: Ted Nyberg (Ted & Gustaf)

I have previously described how to get the simple address of a page and how to get the friendly URL of a page in EPiServer . This post explains how to get the PageReference object or internal URL based on a friendly URL . The goal of the... [ Read full article ]

04 September 2008  5 Comments


How to make virtual path providers work with precompiled EPiServer websites

by: Ted Nyberg (Ted & Gustaf)

Note: This is an experimental workaround. It is not supported by EPiServer nor Microsoft. Introduction Earlier I wrote a post on how you can Precompile your web site to publish it without source code or markup . Minutes after publishing it I was... [ Read full article ]

03 September 2008  4 Comments


Using web parts in EPiServer

by: Ted Nyberg (Ted & Gustaf)

As Stein Viggo points out in his EPiServer on Steroids post, traditional page type templates can limit editor creativity. Having editors enter values for page properties and placing these values within well-defined templates can do miracles for... [ Read full article ]

26 August 2008  11 Comments


Using web parts in EPiServer

by: Ted Nyberg (Ted & Gustaf)

This article explains how to use web parts for EPiServer templates using the Web Part Framework for EPiServer which is available on EPiCode. [ Read full article ]

26 August 2008  0 Comments


Run a scheduled job as a specific EPiServer user

by: Ted Nyberg (Ted & Gustaf)

As noted in my post about how to Create a custom scheduled job in EPiServer all scheduled runs will execute as an anonymous user whereas jobs that are executed manually are run as the current EPiServer user. How to log on programmatically as a... [ Read full article ]

18 August 2008  3 Comments


Run a scheduled job as a specific EPiServer user

by: Ted Nyberg (Ted & Gustaf)

This post shows how to login to an EPiServer site programmatically, for example to execute a scheduled job as a specific user. [ Read full article ]

18 August 2008  0 Comments


How to get the simple address of a page in EPiServer

by: Ted Nyberg (Ted & Gustaf)

This post explains how to get the simple address of a page, if any. As it turns out, it's just a matter of getting the PageExternalURL property. [ Read full article ]

15 August 2008  0 Comments


How to get the simple address of a page in EPiServer

by: Ted Nyberg (Ted & Gustaf)

The following code snippet shows how to retrieve the simple address of an EPiServer page. If you want to retrieve the friendly URL of an EPiServer page instead, please see my post on How to get the friendly URL of a page in EPiServer CMS .... [ Read full article ]

15 August 2008  3 Comments


Create a custom scheduled job in EPiServer

by: Ted Nyberg (Ted & Gustaf)

This post explains how to create a scheduled job in EPiServer CMS. Introduction A scheduled job in EPiServer is essentially a piece of code that will be executed repeatedly at a given time interval, or when an administrator manually executes it... [ Read full article ]

08 August 2008  3 Comments


Create a scheduled job in EPiServer

by: Ted Nyberg (Ted & Gustaf)

This post explains how to create a scheduled job in EPiServer CMS. [ Read full article ]

08 August 2008  0 Comments


Create a custom URL rewrite provider for EPiServer

by: Ted Nyberg (Ted & Gustaf)

Post explaining how to implement a custom URL rewrite provider in EPiServer by inheriting the FriendlyUrlRewriteProvider class and customizing its behavior. [ Read full article ]

24 July 2008  0 Comments


Implementing a custom URL rewrite provider for EPiServer

by: Ted Nyberg (Ted & Gustaf)

Introduction I'm a firm believer in avoiding querystring parameters in URLs, especially for public web sites. Security, SEO and esthetics are a few reasons why. Custom URL rewriting can help you avoid those ugly ampersands and question marks, even... [ Read full article ]

24 July 2008  9 Comments


Using a single domain strategy with multiple languages in EPiServer

by: Ted Nyberg (Ted & Gustaf)

Introduction This post covers one way of enforcing a domain strategy for multi-language (or multi-division) sites. There are two common scenarios for multi-language site domain strategies: Use one top domain per language In this case, www.mysite.c... [ Read full article ]

04 April 2008  4 Comments


Using LINQ and EPiServer

by: Ted Nyberg (Ted & Gustaf)

Just as a brief proof of concept I decided to use a LINQ statement to retrieve and sort a list of EPiServer pages. If you haven't yet come across LINQ I would recommend Scott Guthrie's post on using LINQ . LINQ can be used to query a number of... [ Read full article ]

10 March 2008  104 Comments


Modify and publish a page programmatically

by: Ted Nyberg (Ted & Gustaf)

Inspired by Marek's post on modifying existing pages I  decided to complement my post on programmatically publishing new pages with a post on how to modify and publish existing pages in EPiServer. 1. Why you can't modify a PageData object As Marek... [ Read full article ]

06 March 2008  5 Comments


Create and publish a page programmatically

by: Ted Nyberg (Ted & Gustaf)

This post explains in detail how to programmatically create a page in EPiServer CMS 5. It also shows how to publish a page through code, even when the current user lacks the necessary permissions. 1. Specify where to publish the page Start off by... [ Read full article ]

05 March 2008  10 Comments


Search by language branch in EPiServer

by: Ted Nyberg (Ted & Gustaf)

This post is a complement to my previous post about searching pages with EPiServer . I have gotten a few questions about how to limit a page search to include pages from a specific language branch. Since this is truly a basic requirement when... [ Read full article ]

02 March 2008  5 Comments


Search for EPiServer pages based on properties

by: Ted Nyberg (Ted & Gustaf)

This post aims to clearly illustrate a way of searching for EPiServer pages based on property values. By specifying search criteria and a place to start the search you'll get a PageDataCollection containing all matching pages. The concept The... [ Read full article ]

26 February 2008  12 Comments


Check to see if a page exists for a specific language branch

by: Ted Nyberg (Ted & Gustaf)

Have you ever wanted to know if a specific EPiServer page exists for a specific language? I recently came across an implementation that looked something like this: try { DataFactory.Instance.GetPage(myPageLink, new LanguageSelector( "en" ); } catc... [ Read full article ]

11 February 2008  2 Comments


Programmatically configure customErrors redirects

by: Ted Nyberg (Ted & Gustaf)

I previously posted a possible solution for handling 404 exceptions in EPiServer websites, but here's an alternative and possibly more elegant way of configuring custom error redirects for EPiServer. What I wanted to accomplish I wanted to be able... [ Read full article ]

09 February 2008  11 Comments


How to get the friendly URL of a page in EPiServer CMS

by: Ted Nyberg (Ted & Gustaf)

Maybe there are other posts about this, but I thought I'd share an easy way of getting the friendly URL of a page since I've gotten questions about it on numerous occasions: public static string GetFriendlyURL( PageReference PageLink, string URL) ... [ Read full article ]

07 February 2008  9 Comments


Handle 404 exceptions in EPiServer CMS

by: Ted Nyberg (Ted & Gustaf)

As many of you know, there is a comprehensive 404 handler available for download through EPiCode. However, I just wanted a simple way of specifying a PageID and have that page act as a 404 response. Easier said than done it seems I actually got my... [ Read full article ]

07 February 2008  10 Comments


How to get the friendly URL of a page in EPiServer CMS

by: Ted Nyberg (Ted & Gustaf)

This post explains how to get the friendly URL of a page in EPiServer, handy for those cases where you won't get automatic rewriting of internal URLs. [ Read full article ]

07 February 2008  0 Comments


Disable URL rewriting for specific URLs

by: Ted Nyberg (Ted & Gustaf)

There comes a time when you need to prohibit URL rewriting for specific URLs within your EPiServer CMS website. For example, I've implemented an ashx handler that is used to deliver vCard files on our company's web site. If I would insert a regula... [ Read full article ]

17 January 2008  67 Comments

Ted Nyberg (Ted & Gustaf)

About me

I'm an EPiServer solution architect and web developer at Ted & Gustaf in Stockholm, Sweden.

I cross-post and publish additional articles on tedgustaf.com.

You'll find my contact details here.

EMVP, EPiServer Most Valued Professional

MCPD, MCTS and MCP logos

Follow me on Twitter

Bloggtoppen.se

Add to Technorati Favorites

Syndications


Archive


Tag cloud

EPiTrace logger