Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/development/fieldtypes/fieldtypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ Display the field data as column in the Entry Manager
| \$entry | `Array` | Current `ChannelEntry` object |
| Returns | `String` | The string to display in Entry Manager column |

#### `EE_Fieldtype::getTableColumnConfig()`

Sets [table column configuration](development/services/table.html#setting-the-columns) for Entry Manager

Returns `Array`

#### `EE_Fieldtype::validate($data)`

Validates the field input
Expand Down
30 changes: 28 additions & 2 deletions docs/development/tab-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ lang: php
[TOC]

## Overview
Add-ons can also add tabs which are visible on in [Publish Layouts](control-panel/channels.md#publish-layouts). Respectivley these tabs would also be visible on the Entry Publish/Edit page if selected in the publish layout. Two things are required for your add-on to have this functionality:
Add-ons can also add tabs which are visible on in [Publish Layouts](control-panel/channels.md#publish-layouts). Respectively these tabs would also be visible on the Entry Publish/Edit page if selected in the publish layout. Tabs can also optionally display the associated data as columns in Entry Manager.

Two things are required for your add-on to have this functionality:
- [`tabs()` method](/development/add-on-update-file.md#add-publish-tabs-with-your-add-on-tabs) added to the Update File
- The Tab File (`tab.[addon_name].php`)

Expand Down Expand Up @@ -75,6 +77,13 @@ class Amazing_add_on_tab
}


// This function is needed to display data as an Entry Manager column
public function renderTableCell($data, $field_id, $entry)
{
$entry_meta = $this->getEntryMeta($entry->entry_id);
return json_encode($entry_meta);
}

}
```

Expand Down Expand Up @@ -201,4 +210,21 @@ Called during a `ChannelEntry` entity's `afterSave` event, this allows you to in
| \$entry_ids | `array` | Channel ID where the entry is being created or edited |
| Returns | `Void` | |

Called during a `ChannelEntry` entity's `beforeDelete` event, this allows you to sync your records if any are tied to channel entry_ids.
Called during a `ChannelEntry` entity's `beforeDelete` event, this allows you to sync your records if any are tied to channel entry_ids.

### `renderTableCell($data, $field_id, $entry)`

Display the tab data as column in the Entry Manager

| Parameter | Type | Description |
| --------- | -------- | ----------------------------------------- |
| \$data | `Array` | Ignored by tab files |
| \$field_id| `Int` | Ignored by tab files |
| \$entry | `Array` | Current `ChannelEntry` object |
| Returns | `String` | The string to display in Entry Manager column |

#### `getTableColumnConfig()`

Sets [table column configuration](development/services/table.html#setting-the-columns) for Entry Manager

Returns `Array`