Skip to content

Instantly share code, notes, and snippets.

@davidknipe
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidknipe/b4cc2c2ad2b5ab37e56d to your computer and use it in GitHub Desktop.
Save davidknipe/b4cc2c2ad2b5ab37e56d to your computer and use it in GitHub Desktop.
EPiServer Powerslice example slides
[ServiceConfiguration(typeof(IContentQuery)), ServiceConfiguration(typeof(IContentSlice))]
public class PagesSlice : ContentSliceBase<StandardPage>
{
public override string Name
{
get { return "Pages"; }
}
}
[ServiceConfiguration(typeof(IContentQuery)), ServiceConfiguration(typeof(IContentSlice))]
public class ArticleSlice : ContentSliceBase<ArticlePage>
{
public override string Name
{
get { return "Articles"; }
}
public override IEnumerable<CreateOption> CreateOptions
{
get
{
var contentType = ContentTypeRepository.Load(typeof(ArticlePage));
yield return new CreateOption(contentType.LocalizedName, ContentReference.StartPage, contentType.ID);
}
}
}
[ServiceConfiguration(typeof(IContentQuery)), ServiceConfiguration(typeof(IContentSlice))]
public class BlocksSlice : ContentSliceBase<SiteBlockData>
{
public override string Name
{
get { return "Blocks"; }
}
}
[ServiceConfiguration(typeof(IContentQuery)), ServiceConfiguration(typeof(IContentSlice))]
public class MediaSlice : ContentSliceBase<MediaData>
{
public override string Name
{
get { return "Media"; }
}
}
[ServiceConfiguration(typeof(IContentQuery)), ServiceConfiguration(typeof(IContentSlice))]
public class ImagesSlice : ContentSliceBase<ImageFile>
{
public override string Name
{
get { return "Images"; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment