Per Nergård
Mar 18, 2016
(1 votes)

Order content types with drag and drop

A while back I did a custom plugin that allowed admins to reorder tabs using drag and drop. Another thing I always wanted to be able to do easier is to change the sortorder of content types and also set access rights.

It's possible today but it's a bit tedious with serveral clicks to get into the proper dialog and you don't have an clear overview how access rights are setup.

So I did another admin plugin for this. You can sort both page types and block types with drag and drop and you can easily manage access rights. If you don't want to use drag and drop there is two buttons to sort by either full name or type name. Full name is the type name prefixed with the GroupName property on the types ContentType attribute. The tables are sorted by sortindex which is what epi uses as standard both in admin mode and when creating a new content in edit mode.

Depending on your solution and how many types you have you may or may not want to use the GroupName attribute. Normally I don't use it so all page types is grouped below "Other" when creating a new page. 

When you hit save what the plugin does is change the sortorder index value according to the sort order in the plugin. It starts at 100 and uses step of 100. Both Save buttons processes both page and block types. 

See pictures below and you can get the code over at my Gist.

Image page types.jpg

Image block types.jpg

Mar 18, 2016


Please login to comment.
Latest blogs
Plug-in manager is back in CMS 12

Plug-in manager is back in the UI, what is it and how can i use it?

Luc Gosso (MVP) | Oct 6, 2022 | Syndicated blog

Display Child Pages in Content Delivery API Response

The below example will implement an instance of IContentConverterProvider to customise the serialisation of PageData and output child pages in the...

Minesh Shah (Netcel) | Oct 4, 2022

Bring the Report Center back in Optimizely CMS 12

The Report Center has been a part of Optimizely CMS since its first debut in version 5R2 in 2008, but in CMS 12, it's removed! Don't despair! Make...

Tomas Hensrud Gulla | Oct 4, 2022 | Syndicated blog

Customizing Property Lists in Optimizely CMS

Generic property lists is a cool editorial feature that has gained a lot of popularity - in spite of still being unsupported (officially). But if y...

Allan Thraen | Oct 2, 2022 | Syndicated blog

Optimizely names Luminary Senior Developer, Ynze Nunnink, OMVP

Luminary Senior Developer and Optimizely Lead, Ynze Nunnink has secured the coveted position of Optimizely MVP. Earning a Platinum badge for his...

Ynze | Oct 2, 2022 | Syndicated blog

Content Delivery API – The Case of the Duplicate API Refresh Token

Creating a custom refresh provider to resolve the issues with duplicate tokens in the DXC The post Content Delivery API – The Case of the Duplicate...

David Lewis | Sep 29, 2022 | Syndicated blog