Skip to content

Instantly share code, notes, and snippets.

@gregwiechec
gregwiechec / NoPreviewContentAreaEditorDescriptor.cs
Created September 18, 2015 18:37
Allow to disable preview options on specific ContentAreas
[EditorDescriptorRegistration(TargetType = typeof(ContentArea), UIHint = UIHint)]
public class NoPreviewContentAreaEditorDescriptor : EditorDescriptor
{
public const string UIHint = "NoPreviewContentArea";
public NoPreviewContentAreaEditorDescriptor()
{
this.ClientEditingClass = "alloy.editors.contentAreaWithNoOptions";
}
@gregwiechec
gregwiechec / ArticleWithSlider.cs
Created September 29, 2015 16:25
Content references list with preview
[SiteContentType(GUID = "263B8330-791D-4A5E-BAE4-E7B59F93D3FB")]
public class ArticleWithSlider: ArticlePage
{
[UIHint(MultipleReferencesEditorWithPreviewDescriptor.UiHint)]
[Display(GroupName = SystemTabNames.Content, Name = "Carousel", Order = 100)]
public virtual IList<ContentReference> ContentReferencesCollection { get; set; }
}
@gregwiechec
gregwiechec / SoftLinkIndexerTool.aspx
Created October 5, 2015 21:52
EPiServer Admin plugin - Reindex Soft Links
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SoftLinkIndexerTool.aspx.cs" Inherits="ChildrenGridView.Plugins.SoftLinkIndexerTool" %>
<asp:Content ContentPlaceHolderID="MainRegion" runat="server">
<asp:Button runat="server" Text="Run" OnClick="OnClick"/>
<asp:Label ID="lblResult" runat="server" Text=""></asp:Label>
</asp:Content>
@gregwiechec
gregwiechec / CompareWithMarkup.cs
Created October 22, 2015 09:20
EPiServer compare with markup
using EPiServer.Core;
using EPiServer.ServiceLocation;
using EPiServer.Shell;
namespace ExtendingCompareVersion.Business.ViewConfiguration
{
[ServiceConfiguration(typeof(EPiServer.Shell.ViewConfiguration))]
public class CompareWithMarkup : ViewConfiguration<IContentData>
{
public CompareWithMarkup()
@gregwiechec
gregwiechec / CreateContentViewModel.js
Created November 6, 2015 06:35
Show additional properties on content creation
define("epi-cms/contentediting/viewmodel/CreateContentViewModel", [
// dojo
"dojo/_base/array",
"dojo/_base/declare",
"dojo/_base/lang",
"dojo/_base/json",
"dojo/Stateful",
"dojo/string",
"dojo/when",
@gregwiechec
gregwiechec / ExtendedCollectionEditor.js
Created December 22, 2015 20:10
PropertyList with image
define([
"dojo/_base/array",
"dojo/_base/declare",
"dojo/_base/lang",
"epi-cms/contentediting/editors/CollectionEditor",
"alloy/editors/extendedFormatters"
],
function (
array,
declare,
@gregwiechec
gregwiechec / FavouriteContent.cs
Last active September 16, 2016 19:54
Editor Favourite Content
using EPiServer.Shell.ViewComposition;
namespace FavouriteContentList.Business.FavouriteContent
{
[Component]
public class FavouriteContent : ComponentDefinitionBase
{
public FavouriteContent()
: base("favourites.favouriteContentComponent")
{
@gregwiechec
gregwiechec / textarea with statistics - styles
Created May 20, 2016 10:44
textarea with statistics property
.extended-textArea .textArea-wrapper {
display: inline-block;
}
.extended-textArea textarea {
width: 500px;
}
.extended-textArea .statistics {
display: inline-block;
@gregwiechec
gregwiechec / FakeStringFragment.cs
Created June 6, 2016 12:07
Rendering current page in ContentArea
using System.Collections.Generic;
using ContentAreaWithPreview.Models.Pages;
using EPiServer;
using EPiServer.Core;
using EPiServer.Core.Html.StringParsing;
using EPiServer.Security;
using EPiServer.Web;
namespace ContentAreaWithPreview.Plugin
{
@gregwiechec
gregwiechec / ContentAreaEditor.js
Created June 13, 2016 10:42
Adding random items to ContentArea
define([
"dojo/_base/declare",
"dojo/_base/lang",
"dojo/when",
"dojo/on",
"dojo/dom-construct",
"epi/dependency",
"epi-cms/contentediting/editors/ContentAreaEditor"
],
function (