Skip to content

Commit 32cafa8

Browse files
authored
Merge pull request #553 from ExpressionEngine/feature/7.x/tabs-in-entry-manager
let tabs display data in entry manager
2 parents 987dc63 + a062b65 commit 32cafa8

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

docs/development/fieldtypes/fieldtypes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ Display the field data as column in the Entry Manager
219219
| \$entry | `Array` | Current `ChannelEntry` object |
220220
| Returns | `String` | The string to display in Entry Manager column |
221221

222+
#### `EE_Fieldtype::getTableColumnConfig()`
223+
224+
Sets [table column configuration](development/services/table.html#setting-the-columns) for Entry Manager
225+
226+
Returns `Array`
227+
222228
#### `EE_Fieldtype::validate($data)`
223229

224230
Validates the field input

docs/development/tab-files.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ lang: php
1717
[TOC]
1818

1919
## Overview
20-
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:
20+
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.
21+
22+
Two things are required for your add-on to have this functionality:
2123
- [`tabs()` method](/development/add-on-update-file.md#add-publish-tabs-with-your-add-on-tabs) added to the Update File
2224
- The Tab File (`tab.[addon_name].php`)
2325

@@ -75,6 +77,13 @@ class Amazing_add_on_tab
7577
}
7678
7779
80+
// This function is needed to display data as an Entry Manager column
81+
public function renderTableCell($data, $field_id, $entry)
82+
{
83+
$entry_meta = $this->getEntryMeta($entry->entry_id);
84+
return json_encode($entry_meta);
85+
}
86+
7887
}
7988
```
8089

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

204-
Called during a `ChannelEntry` entity's `beforeDelete` event, this allows you to sync your records if any are tied to channel entry_ids.
213+
Called during a `ChannelEntry` entity's `beforeDelete` event, this allows you to sync your records if any are tied to channel entry_ids.
214+
215+
### `renderTableCell($data, $field_id, $entry)`
216+
217+
Display the tab data as column in the Entry Manager
218+
219+
| Parameter | Type | Description |
220+
| --------- | -------- | ----------------------------------------- |
221+
| \$data | `Array` | Ignored by tab files |
222+
| \$field_id| `Int` | Ignored by tab files |
223+
| \$entry | `Array` | Current `ChannelEntry` object |
224+
| Returns | `String` | The string to display in Entry Manager column |
225+
226+
#### `getTableColumnConfig()`
227+
228+
Sets [table column configuration](development/services/table.html#setting-the-columns) for Entry Manager
229+
230+
Returns `Array`

0 commit comments

Comments
 (0)