November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Edit mode has drastically changed from EPiServer 6 R2 to 7.5. I would suggest that you don't port your custom property to 7.5, but rather use the GroupName parameter in the Display attribute of the property in order to group your properties into the appropriate tab or "section".
Here is a very simple version we did
(Template.html)
<div> <hr/> </div>
main.js
define([ "dojo/_base/array", "dojo/_base/connect", "dojo/_base/declare", "dojo/_base/lang", "dijit/_CssStateMixin", "dijit/_Widget", "dijit/_TemplatedMixin", "dijit/_WidgetsInTemplateMixin", "dijit/form/Textarea", "epi/epi", "epi/shell/widget/_ValueRequiredMixin" ], function ( array, connect, declare, lang, _CssStateMixin, _Widget, _TemplatedMixin, _WidgetsInTemplateMixin, Textarea, epi, _ValueRequiredMixin ) { return declare("customer.editors.Separator.Main", [_Widget, _TemplatedMixin, _WidgetsInTemplateMixin, _CssStateMixin, _ValueRequiredMixin], { templatePath: dojo.moduleUrl('active.editors.Separator', 'Template.html'), intermediateChanges: false, value: null, multiple: true, baseClass: "epiLongString", onChange: function (value) { // Event }, postCreate: function () { // call base implementation this.inherited(arguments); }, isValid: function () { return true; }, // Setter for value property _setValueAttr: function (value) { this._setValue(value); }, _setReadOnlyAttr: function (value) { this._set("readOnly", value); }, // Setter for intermediateChanges _setIntermediateChangesAttr: function (value) { this._set("intermediateChanges", value); }, // Event handler for textarea _onTextAreaChanged: function (value) { this._setValue(value, false); }, _setValue: function (value) { this.value = value; }, }); });
SeperatorEditorDescriptor.cs
using System; using System.Collections.Generic; using EPiServer.Shell.ObjectEditing; using EPiServer.Shell.ObjectEditing.EditorDescriptors; namespace Customer.Web.Framework.EditorDescriptors.Separator { [EditorDescriptorRegistration(TargetType = typeof(string), UIHint = Global.SiteUIHints.Separator)] public class SeparatorEditorDescriptor : EditorDescriptor { public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes) { ClientEditingClass = "customer.editors.separator.main"; base.ModifyMetadata(metadata, attributes); } } }
Read more on how to create custom properties here:
tedgustaf.com/sv/blogg/2014/6/create-an-episerver-widget-for-edit-mode/
Good luck!
Great Komal!
Please mark my response as Answer so others can see that the thread is answerd
This is an old pretty 'ugly' solution to the problem of grouping.
Grouped properties are mostly used by the same function, it would be better if your were able to group these using Blocks as Properties instead.
True Alf, but it is a quick fix in a migration project and after that look at each place it is being used and se if it is still needed with the new better onpage editor.
we have the code but does not use it anymore.
Hi,
I want to display horizontal line in Edit mode so i have created one custom property and but when i debug a code, it doesn't call CreatePropertyControl(). It was working in EpiServer6R2 but not in 7.5.
Can you please suggest any solution?