Skip to content

Instantly share code, notes, and snippets.

@gregwiechec
gregwiechec / initializer.js
Created June 17, 2024 20:57
Updating language versions with property copy and publish
define([
// Dojo
"dojo", "dojo/_base/declare", "dojo/on", "dojo/when", "dijit/registry",
// dijit
"dijit/layout/_LayoutWidget", "dijit/_TemplatedMixin", "dijit/_WidgetsInTemplateMixin", "dijit/form/CheckBox",
//epi
"epi/_Module", "epi/dependency",
@gregwiechec
gregwiechec / initializer.js
Created June 6, 2024 08:49
Updating language versions
define([
// Dojo
"dojo", "dojo/_base/declare", "dojo/on", "dojo/when", "dijit/registry",
// dijit
"dijit/layout/_LayoutWidget", "dijit/_TemplatedMixin", "dijit/_WidgetsInTemplateMixin", "dijit/form/CheckBox",
//epi
"epi/_Module", "epi/dependency",
@gregwiechec
gregwiechec / CascadingDropdown.cs
Created May 14, 2024 11:12
Cascading dropdown
using EPiServer.Shell.ObjectEditing;
using EPiServer.Shell.ObjectEditing.EditorDescriptors;
using EPiServer.Shell.Services.Rest;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace OptiAlloy;
public static class CascadingDropdownEditor
{
@gregwiechec
gregwiechec / ExtendedChangeManager.cs
Last active December 12, 2023 22:55
Copying inline blocks when translating pages
using System.Collections.Generic;
using EPiServer;
using EPiServer.Cms.Shell.UI.Rest;
using EPiServer.Cms.Shell.Workspace.Committers;
using EPiServer.Core;
using EPiServer.Data.Entity;
using EPiServer.DataAccess;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.Security;
@gregwiechec
gregwiechec / DateEditor.js
Created December 7, 2023 13:44
Date property
define([
"dojo/_base/declare",
"epi/shell/widget/DateTimeSelector",
"epi/shell/widget/DateTimeSelectorDropDown"
], function(
declare,
DateTimeSelector,
DateTimeSelectorDropDown
) {
function dateToString(date) {
@gregwiechec
gregwiechec / ExtendedSelectItem.cs
Created June 6, 2023 20:59
Extended SelectionFactory
public class ExtendedSelectItem: SelectItem
{
public string Class { get; set; }
public string IconClass { get; set; }
}
@gregwiechec
gregwiechec / initializer.js
Last active April 20, 2023 20:18
ContentArea default display options
define([
"dojo",
"dojo/_base/declare",
"dojo/aspect",
"dojo/when",
"epi/_Module",
"epi-cms/contentediting/editors/ContentAreaEditor",
"epi-cms/contentediting/editors/_ContentAreaTreeModel"
@gregwiechec
gregwiechec / ColorEditor.js
Created March 2, 2023 21:41
EPiserver ColorPicker property
define([
"dojo/_base/declare",
"dijit/_CssStateMixin",
"dijit/_Widget",
"dijit/_TemplatedMixin",
"dijit/_WidgetsInTemplateMixin",
"epi/shell/widget/_ValueRequiredMixin"
],
@gregwiechec
gregwiechec / CustomUriContextResolver.cs
Created June 21, 2016 08:23
Deleting single file from trash
using System;
using EPiServer.Cms.Shell.UI.Rest;
using EPiServer.Cms.Shell.UI.Rest.Models;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;
using EPiServer.Shell.Rest;
namespace ContentAreaWithPreview.Business
{
@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 (