Column

Introduction

Custom Columns give you the ability to show your entries meta values immediately on the list screens of singularities.

Registering Columns

Each singularity that supports custom columns has columns method. This method needs to return an array of Column instances.

use Column;

public function columns() {
    return [
        Column::taxonomy('App\Taxonomies\Genres'),
    ];
}

Column types

List of singularities and they supported custom column types:

Singularity type Supported column types
Posttype metabox, taxonomy
Taxonomy term
User profile

Metabox Column

Metabox column allows for presenting metadata values of your posts. It requires two arguments. First is desired metabox classname, second is a field depth path in "dot" notation.

Column::metabox($metabox, $field);

Example:

Column::metabox('App\Metaboxes\MovieDetails', 'release_date');

Taxonomy Column

Taxonomy column allows for presenting chosen terms of your posts taxonomies.

Column::taxonomy($taxonomy);

Example:

Column::taxonomy('App\Taxonomies\Genres');

Term Column

Term column allows for displaying metadata values of your taxonomy terms. It requires two arguments. First is desired taxonomy classname, second is a field depth path in "dot" notation.

Column::term($term, $field);

Example:

Column::term('App\Taxonomies\Genres', 'color');

Profile Column

Profile column allows for presenting metadata values of your user's profiles. It requires two arguments. First is desired taxonomy classname, second is a field depth path in "dot" notation.

Column::profile($profile, $field);

Example:

Column::profile('App\Profile\Reviewer', 'rank');

Accessing fields for Columns

Pulling fields with "dot" notation

Some Column can display fields previews, in this situation, the second argument will accept depth path in "dot notation".

For example, you organized fields within Fielder tabs and want to display the text field which is placed inside one of tab.

use Field;

Field::tabs('tabs')->children([
    Field::tab('tab')->children([
        Field::text('text'),
    ]),
]),

The depth path to this field will look like this tabs.tab.text. Easy, right?

Column::metabox('App\Metaboxes\CustomMetabox', 'tabs.tab.text')