Skip to content

Instantly share code, notes, and snippets.

@gregwiechec
gregwiechec / Dojo widget
Last active August 29, 2015 14:21
EPiServer - Nullable date property
define([
"dojo/_base/declare",
"dojo/_base/lang",
"dojo/dom-style",
"dojo/dom-construct",
"dojo/keys",
"dojo/on",
"epi/shell/widget/DateTimeSelectorDropDown"
],
function(
@gregwiechec
gregwiechec / Dojo widget
Last active August 29, 2015 14:21
EPiServer - Content Area as Image list
define([
"dojo/_base/array",
"dojo/_base/connect",
"dojo/_base/declare",
"dojo/_base/lang",
"dojo/query",
"dojo/dom-class",
"dojo/on",
"dojo/dom",
"dijit/popup",
@gregwiechec
gregwiechec / ProdcutDetailsUiDescriptor & ProductFormEditing
Created May 13, 2015 18:56
EPiServer - Extending “All properties” view
using EPiServer.Cms.Shell.UI.UIDescriptors.ViewConfigurations;
using EPiServer.ServiceLocation;
using EPiServer.Shell;
using EpiServerThumbnail.Models.Pages;
namespace EpiServerThumbnail.Business.EditorDescriptors
{
[UIDescriptorRegistration]
public class ProdcutDetailsUiDescriptor : UIDescriptor<ProductPage>
{
using System;
using System.Collections.Generic;
using EPiServer.Shell;
using EPiServer.Shell.ObjectEditing;
using EPiServer.Shell.ObjectEditing.EditorDescriptors;
namespace EpiServerThumbnail.Business.EditorDescriptors
{
[EditorDescriptorRegistration(TargetType = typeof (bool), UIHint = UiHint)]
[EditorDescriptorRegistration(TargetType = typeof(bool?), UIHint = UiHint)]
@gregwiechec
gregwiechec / ConfigurableSqlClientFactory
Created June 19, 2015 22:04
Custom Database Provider Factory
using System.Data;
using System.Data.Common;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Reflection;
using System.Security;
using System.Security.Permissions;
namespace CustomSqlProvider
{
@gregwiechec
gregwiechec / ExtendedContentReferenceSelctorAttribute.cs
Last active August 29, 2015 14:26
Content Selector with page preview
public class ExtendedContentReferenceSelctorAttribute : Attribute, IMetadataAware
{
public void OnMetadataCreated(ModelMetadata metadata)
{
((ExtendedMetadata)metadata).ClientEditingClass = "alloy.editors.extendedContentSelector";
}
}
@gregwiechec
gregwiechec / eventsLogger.js
Last active August 29, 2015 14:27
Subscribing to EPiServer system topics
define([
"dojo",
"dojo/_base/declare",
"epi/_Module",
"dojo/topic"
], function(
dojo,
declare,
_Module,
topic
@gregwiechec
gregwiechec / SearchMonitor.aspx
Created August 18, 2015 14:57
Search Monitoring tool
<%@ Page Language="c#" Codebehind="SearchMonitor.aspx.cs" AutoEventWireup="False" Inherits="EpiServerThumbnail.Views.plugins.SearchMonitor" Title="IndexingService Health Monitor" %>
<asp:Content ContentPlaceHolderID="HeaderContentRegion" runat="server">
<style type="text/css">
.epi-contentContainer {
width: 900px;
}
.epi-contentContainer h2 {
@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; }
}