How to use SelectMany to work with flags enum

31 July 2017 EPiServer, EPiServer properties No comments

EPiServer provides a build-in SelectionFactory for enums and SelectOne attribute for selecting single value. But for flags enum we want to have a checkbox list and be able to select more than one value. In this article I’d like to show how to use SelectMany attribute for editing flags enum property.
property enum flags using SelectMany attribute

How to turn off autopublish in ContentArea

25 July 2017 EPiServer, EPiServer properties No comments

When creating new block directly from ContentArea, the block is automatically published and added to ContentArea. This behavior is not configurable. In this article I will show how to add new block as a draft.
Creating new block from ContentArea

Generic PropertySoftLinkIndexer for ListProperty

6 July 2017 EPiServer, EPiServer properties No comments

When creating new property type that stores content references then it’s recommended to implement PropertySoftLinkIndexer class. It will be used for indexing links to other content. For example when item type of PropertyList has ContentReference property then we should implement PropertySoftLinkIndexer returning all links from the list. In this article I will show how to implement generic PropertySoftLinkIndexer for PropertyList.
PropertySoftLinkIndexer deleting page

Creating a page shortcut using drag and drop

17 June 2017 EPiServer, EPiServer properties No comments

When creating page shortcut, Editor has to open setting tab, then click Manage link on shortcut property and then find a destination page in tree. So when he found a target page in Navigation Pane, then to create a shortcut he has to find it once again in the dialog. I prepared a functionality of creating shortcuts using D&D directly from Navigation Pane.


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…)

Hiding Content Details elements

19 April 2017 EPiServer No comments

In Edit Mode, the Content Details Panel shows information about Content Type, internal ID, roles and languages. It could be useful for administrators, but sometimes we would like to hide it for editors. Below I will describe how can we control the visibility of those elements. There are two versions of code. First shows how to hide elements for all users and second how to hide elements only for editors.

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…)

Problem with permanent redirects shortcuts

9 January 2017 EPiServer No comments

A while ago I was struggling with permanent redirects problem. The page linked as a shortcut was not updated; always first version was used as a redirect destination. I had no idea where it could be cached. Of course at the end it turned out that the explanation of this situation is very obvious. (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

Deleting single file from trash

23 June 2016 EPiServer 7 comments

There are many situations when the solution works on Development and Test environments, but there are some problems with Production. Few times I had to create test page, check how system behaves and then delete the page. There is no Permanent Delete option for single content, so I had to empty whole trash or leave the test page. That’s why I tried to prepare functionality of deleting single file from trash.
extended trash component (more…)