function hook_farm_dashboard_panes in farmOS 2.x
Same name and namespace in other branches
- 7 modules/farm/farm_dashboard/farm_dashboard.api.php \hook_farm_dashboard_panes()
Defines farm dashboard panes.
Return value
array Returns an array of farm dashboard pane configurations.
4 functions implement hook_farm_dashboard_panes()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- farm_ui_dashboard_test_farm_dashboard_panes in modules/
core/ ui/ dashboard/ tests/ modules/ dashboard_test/ farm_ui_dashboard_test.module - Implements hook_farm_dashboard_panes().
- farm_ui_map_farm_dashboard_panes in modules/
core/ ui/ map/ farm_ui_map.module - Implements hook_farm_dashboard_panes().
- farm_ui_metrics_farm_dashboard_panes in modules/
core/ ui/ metrics/ farm_ui_metrics.module - Implements hook_farm_dashboard_panes().
- farm_ui_views_farm_dashboard_panes in modules/
core/ ui/ views/ farm_ui_views.module - Implements hook_farm_dashboard_panes().
File
- modules/
core/ ui/ dashboard/ farm_ui_dashboard.api.php, line 23 - Hooks provided by farm_ui_dashboard.
Code
function hook_farm_dashboard_panes() {
return [
// A pane is defined with an associative array, keyed with a unique pane
// machine name.
'my_pane' => [
// Specify a 'view' and 'view_display ID' to automatically load a View.
// This will take precedence over 'block' below.
'view' => 'my_view',
'view_display_id' => 'block_1',
// Specify a block plugin ID to automatically load a Block.
'block' => 'my_block',
// Optional arguments to pass to the view or block.
// This is useful if the view or block can be used in different contexts.
'args' => [
'arg1' => FALSE,
'arg2' => 'logs',
],
// Optionally specify a title. By default the view's title or the block's
// label will be used.
'title' => t('My pane title'),
// Optionally specify a layout region. Defaults to 'first'.
// Options are: top, first, second or bottom.
'region' => 'top',
// Optionally specify a group and weight for display sorting.
'group' => 'custom_group',
'weight' => 100,
],
];
}