EPiServer properties

How to create SelectionFactory with parameters?

8 June 2017 EPiServer, EPiServer properties No comments

To create a property with list of available options we usually use SelectionFactory. One SelectionFactory class can be used on many properties. But sometimes, for specific property, we want one or two extra selection items. The SelectOne and SelectMany attributes have SelectionFactoryType property which is a factory type not the factory instance. In this article I’d like to show how create SelectionFactory with parameters. (more…)

Shortcut to a Media File

30 March 2017 EPiServer, EPiServer properties No comments

When building a menu you would probably build it based on the page tree structure, where each menu item would be a regular link to a page.

However, sometimes you would like one of the links to point to another page, a media file or an external site. Here comes the Shortcut functionality which allows you to do just that.

Content Selector for media - menu (more…)

Trying out PropertyValueList

1 July 2016 EPiServer, EPiServer properties No comments

Since few months PropertyList<int> property is available in EPiServer. It allows to create list of blocks. List value is serialized to JSON and stored together with Page. The property doesn’t allow to work with simple types like strings or integers. An example of string list property can be found in AlloyTech demo. Editing widget is represented by textarea, so the editor needs to know that items are separated with line breaks. For other types like numbers or dates I didn’t find the implementation. That’s why I prepared PropertyValue<int> property where T is a simple type like string, integer or date.
PropertyListValue editor
(more…)

Adding random items to ContentArea

15 June 2016 EPiServer, EPiServer properties No comments

In one of our projects we have News page type. It has a “see more” section with links to other news pages. When editor is creating New page, he adds few articles to “see more” section. In some situations he would like to pick few random pages. I extended ContentArea with adding random items functionality.
Adding random items to ContentArea (more…)

TextArea with statistics

22 May 2016 EPiServer, EPiServer properties No comments

For the plain text like introductions or short descriptions we use TextArea property. It could be useful for editor to see how many characters and words he already typed. It gives an overview of how much space for new value is required. That’s why I decided to implement property TextArea with statistics.
TextArea with statistics
(more…)

How to disable creating new blocks in Content Area

18 May 2016 EPiServer, EPiServer properties 1 comment

In some scenarios we would like to disable creating new blocks functionality on Content Areas. Then editors will add only existing items using drag and drop functionality. We could implement one of few solutions to meet this requirement. It can be EditorDescriptor with client widget or quick hack enclosed in 10 lines of backend code.
Content Area no create new link
(more…)

How to render line breaks for string property

13 May 2016 EPiServer, EPiServer properties 2 comments

In one of out projects I had a requirement to prepare a multiline text property that supports line breaks. It had to be a standard textarea field with no HTML elements just plain text with new line support. The dojo editor didn’t require changes, because line breaks were stored during saving property data. Only value renderer had to be implemented.
TextArea editor
(more…)

Client module with server side parameters

25 April 2016 EPiServer, EPiServer properties No comments

Few weeks ago I described how to extend Tools menu with additional Move to trash command. Trash button was displayed only for News pages. For all other page types button was not displayed. What if we need to show the button also on the Article type? We could add another hardcoded Page Type condition to dojo component. It will work but it sounds like a fragile solution. It would be better to store all supported types on the server and send serialized settings to the client module.
server available types (more…)

Updated ContentArea with images

25 March 2016 EPiServer, EPiServer properties No comments

Few months ago I prepared extended version of ContentArea property widget. Editors can use it to preview item thumbnail. In EPiServer 9 the ContentArea widget implementation changed so I updated extension to support the newest version. The UI is the same as before – each item displays content name and image thumbnail, to see larger image we need to click on the element.

ContentArea editor with image preview
(more…)

Creating Dojo widget in TypeScript

21 January 2016 EPiServer, EPiServer properties 4 comments

Episerver edit mode use Dojo framework as a client side technology. When creating new custom property, gadget or command button we should use this JavaScript library to prepare user interface. To have static typing and class-based object-oriented programming I tried to create Dojo widget in TypeScript. In this article I will describe how to develop Alloy demo example StringList property in TypeScript. (more…)