mmikkel / CpSortableCustomColumns-Craft

Adds custom fields to sortable attributes in element indexes
41 stars 5 forks source link

CP Sortable Custom Columns v. 1.1.2 for Craft CMS Craft 2.5

Easily sort your element index tables on custom fields

Sorting on custom fields, like a champ

What?

The Customizable Element Index (CEI) feature in Craft 2.5+ lets users show or hide any custom field and/or metadata to the element indexes (i.e. the table listing your Entries, Categories, Assets or Users). Awesome stuff! Unfortunately though, Craft won't actually let you sort elements on the columns you add – unless you add also add corresponding values to the sortable attributes in a custom plugin. Even then, there are issues, such as the sort menu not being source aware (meaning all custom, sortable attributes added via the modifyEntrySortableAttributes hook will display for all Sections), custom columns' headers are not clickable etc.

CP Sortable Custom Columns is a tiny plugin with a heavy handed name, aiming to hotfix the above issues.

Features

With this plugin installed, any (sortable) custom field or meta value you add to an element index (either via hooks in a plugin, or via the CEI interface) will automatically be available for sorting.

So which FieldTypes are sortable?

Any FieldType (custom or built-in) of the following attribute types are sortable:

Additionally, CP Sortable Custom Columns adds support for sorting on pretty much any meta field, such as Entry Type, Author, Updated Date etc.

Requirements

CP Sortable Custom Columns requires Craft 2.5 or newer.

Installation

Disclaimer, bugs, feature request, support etc.

This plugin is provided free of charge and you can do whatever you want with it. CP Sortable Custom Columns is unlikely to mess up your stuff, but just to be clear: the author is not responsible for data loss or any other problems resulting from the use of this plugin.

Please report any bugs, feature requests or other issues here. Note that this is a hobby project and no promises are made regarding response time, feature implementations or bug fixes.

Pull requests are extremely welcome

Changelog

1.1.2 (06.26.2017)

1.1.1 (06.17.2016)

1.1 (02.24.2016)

1.0.2 (02.08.2016)

1.0.1 (01.31.2016)

1.0.0 (01.31.2016)