Skip to content

Instantly share code, notes, and snippets.

View jamesrpatterson's full-sized avatar

James Patterson jamesrpatterson

View GitHub Profile
@jamesrpatterson
jamesrpatterson / MirroringDynamicContentImageUrl.cs
Created January 12, 2013 16:25
Initialisation module for EPiServer which finds Dynamic Content instances within editable areas and adds any referenced image file to Mirroring exporter.
namespace MyWebsite.Initialization
{
using System;
using System.Collections.Generic;
using System.Linq;
using EPiServer;
using EPiServer.Core;
using EPiServer.DynamicContent;
using EPiServer.Enterprise;
using EPiServer.Enterprise.Enterprise;
@jamesrpatterson
jamesrpatterson / PropertyDCImageUrl.cs
Created January 12, 2013 16:21
Image Url property catching validation errors.
namespace MyWebsite.PropertyTypes
{
using System;
using System.IO;
using EPiServer.SpecializedProperties;
using log4net;
public class PropertyDCImageUrl : PropertyImageUrl
{
private static ILog logger = LogManager.GetLogger(typeof(PropertyDCImageUrl));
@jamesrpatterson
jamesrpatterson / NodesByCategoryExample.cs
Created November 21, 2012 14:57
Getting nodes with a specified category.
int categoryId = 5;
// Let's assume node with ID 45 is the root page of a blog or news section.
foreach (Node node in NodeHelpers.GetNodesInCategory("categories", categoryId, 45))
{
// do something with node.
}
<categories>
<category>
<name>Food and Drink</name>
<description>Category for food and drink blog posts.</description>
<parent>12</parent>
<enabled>True</enabled>
<selectable>True</selectable>
</category>
</categories>