ElencySolutions.MultipleProperty v1.5.1 Released
A few days ago I released a new version of my multiple property assembly. The previous version basically allowed you to set a default value for properties and also added some functionality which enabled you to turn on and off various list based buttons such as edit, delete etc. The button toggling changes came about because of some customizations a colleague of mine had to make for a client.
Unfortunately I made some assumptions about what he was trying to do and didn’t give him what he wanted (note to self do some requirements gathering up front). So I give you v1.5.1.
New Features/Bug Fixes
- Copy as new button will no longer allow you to add more items to the list than the set maximum number of items.
- New IMultiplePropertyEntityAbilityOverride interface.
- New IMultiplePropertyEntityCollectionAbilityOverride interface.
Making use of the new ability override interfaces
You’re entity classes can now implement the IMultiplePropertyEntityAbilityOverride interface. The interface has the following methods:
- bool AllowEdit(PageData pageData, string propertyName);
- bool AllowDelete(PageData pageData, string propertyName);
Within your entity you can then define any custom logic to determine whether the edit and delete buttons can be enabled.
For entity collections List<TEntity> you can implement the IMultiplePropertyEntityCollectionAbilityOverride interface. This interface has the following methods:
- bool AllowAdd(PageData pageData, string propertyName);
- bool AllowEdit(PageData pageData, string propertyName);
- bool AllowDelete(PageData pageData, string propertyName);
This enables you to define custom logic to determine whether add, edit or delete functionality should be enabled across the whole list rather than an individual entity level.
Installation
The easiest way to install the assembly is by installing it from the EPiServer nuget feed (once it has been made available). But if you are not down with the cool kids you can download it from codeplex. The assembly is built for EPiServer CMS 6 and onwards.
On the codeplex site you can also find some useful documentation and example code to get you familiar with what the property offers. The example code is dependent on PageTypeBuilder.
Feedback
As always feedback is greatly appreciated, if you have any suggestions for new features or changes I am happy to hear them.
Just twitter me @croweman or send me an email
Comments