7

Is there a way to show custom columns in the backend with entries listing views? Or can it be a feature in the future? For example: show category as a column in the news overview in the backend

1
  • If you mean something like Zenbu for EE, than that's currently not possible, but it's on list. (I don't know any est. release date though) – Victor In Jun 23 '14 at 13:38
3

This is now possible using the modifyEntryTableAttributes hook. From the docs:

public function modifyEntryTableAttributes(&$attributes, $source)
{
    if ($source == 'section:3')
    {
        unset($attributes['expiryDate']);
        $attributes['id'] = Craft::t('ID');
    }
}

See also: getEntryTableAttributeHtml and modifyEntrySortableAttributes

7

The current answer to this is no, not out of the box.

The unofficial answer to this is, it has been discussed several times out there in the forums and there are some good arguments to make that this is a core part of 'content management'.

The developer-friendly answer to this is yes, you can control those columns if you create a plugin with a new Element Type. Your Element can extend the default Entries Element Type and customize the columns in the listing views.

Within your Element Type:

defineTableAttributes() - Returns the attributes that can be shown/sorted by in table views.

modifyElementsQuery() - Modifies an element query targeting elements of this type.

getSources() - Returns the element type's sources and can be used to trigger filters on the table view.

You can create a new listing template with these three lines of code:

{% extends "_layouts/elementindex" %}
{% set title = "Page Title"|t %}
{% set elementType = 'PluginName_Element' %}

Is this a smart thing to do? It probably depends on your use case. Elements are powerful, but they also take time to develop and maintain. While you can easily extend a class, several parts of the Control Panel UI are not as easy to extend if you start adding variations on the intended use cases. Make your case to P&T about this feature being a core part of content management and if enough others do the same, you may save yourself a lot of custom development. I think there is a strong case that this type of feature can only be done well in the core.

4

Short answer is no, that's not possible.

Longer answer is no, because P&T didn't build it that way. Entries are an element type, and that kind of behavior is buried deep within the element type. Those columns are pre-determined, there's nothing you can do to edit them.

To be honest, I can't even visualize how a 3rd party plugin could be able to modify that part of the Entries UI and insert a column. It kinda needs to be built directly into the element type.

Ultimately, I guess you could make a feature request about it (either on G+ or by emailing support@buildwithcraft.com).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.