Sub-items list¶
The Sub-items List module is meant to be used as a part of the editorial interface of Ibexa DXP. It provides an interface for listing the sub-items of any location.
Create custom sub-items list view¶
You can extend the Sub-items List module to replace an existing view or add your own. The example below adds a new timeline view to highlight the modification date.

To recreate it, start by creating the components responsible for rendering the new view. You can create two files:
assets/js/timeline.view.component.jsresponsible for rendering the whole view
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46  |  | 
assets/js/timeline.view.item.component.jsresponsible for rendering a single item
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34  |  | 
Provide the necessary styling in assets/scss/timeline.view.scss. The example below uses Ibexa DXP's SCSS variables for consistency with the rest of the back office interface.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84  |  | 
The last step is adding the view module to the list of available views in the system, by using the provided registerView function.
You can create a new view by providing an unique identifier, or replace an existing one by reusing its identifier.
The existing view identifiers are defined as JavaScript constants in the @ibexa-admin-ui-modules/sub-items/constants module:
- Grid view: 
VIEW_MODE_GRIDconstant - Table view: 
VIEW_MODE_TABLEconstant 
Create a file called assets/js/registerTimelineView.js:
1 2 3 4 5 6 7 8 9 10 11  |  | 
And include it into the back office using Webpack Encore, together with your custom styles. See configuring assets from main project files to learn more about this mechanism.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  |  | 
Complete the task by running composer run post-install-cmd.
Use sub-items list¶
Caution
If you want to load the Sub-items module from your custom code, you need to load the JS code for it in your view, as it's not available by default.
With plain JS:
1 2 3 4 5 6 7 8 9 10 11 12  |  | 
With JSX:
1 2 3 4 5 6 7 8 9  |  | 
Properties list¶
The <SubItemsModule /> module can handle additional properties.
There are two types of properties: required and optional.
All of them are listed below.
Required props¶
Without all the following properties the Sub-items module cannot work.
- parentLocationId {Number} - parent location ID
 - restInfo {Object} - backend config object:
- token {String} - CSRF token
 - siteaccess {String} - SiteAccess identifier
 
 - handleEditItem {Function} - callback to handle edit content action
 - generateLink {Function} - callback to handle view content action
 
Optional properties¶
Optionally, Sub-items module can take a following list of props:
- loadContentInfo {Function} - loads content item info. Takes two params:
- contentIds {Array} - list of content IDs
 - callback {Function} - a callback invoked when content info is loaded
 
 - loadContentTypes {Function} - loads content types. Takes one param:
- callback {Function} - callback invoked when content types are loaded
 
 - loadLocation {Function} - loads location. Takes four params:
- restInfo {Object} - REST info params:
- token {String} - the user token
 - siteaccess {String} - the current SiteAccess
 
 - queryConfig {Object} - query config:
- locationId {Number} - location ID
 - limit {Number} - content item limit
 - offset {Number} - items offset
 - sortClauses {Object} - the Sort Clauses, for example, {LocationPriority: 'ascending'}
 
 - callback {Function} - callback invoked when location is loaded
 
 - restInfo {Object} - REST info params:
 - updateLocationPriority - updates item location priority. Takes two params:
- params {Object} - parameters hash containing:
- priority {Number} - priority value
 - location {String} - REST location ID
 - token {String} - CSRF token
 - siteaccess {String} - SiteAccess identifier
 
 - callback {Function} - callback invoked when location priority is updated
 
 - params {Object} - parameters hash containing:
 - activeView {String} - active list view identifier
 - extraActions {Array} - list of extra actions. Each action is an object containing:
- component {Element} - React component class
 - attrs {Object} - additional component properties
 
 - items {Array} - list of location's sub-items
 - limit {Number} - items limit count
 - offset {Number} - items limit offset
 - labels {Object} - list of module labels, see sub.items.module.js for details. Contains definitions for sub components:
- subItems {Object} - list of sub-items module labels
 - tableView {Object} - list of table view component labels
 - tableViewItem {Object} - list of table item view component labels
 - loadMore {Object} - list of load more component labels
 - gridViewItem {Object} - list of grid item view component labels
 
 - languageContainerSelector {String} - selector where the language selector should be rendered
 
Reuse Sub-items list¶
To add a Sub-items list on a page that doesn't have the (right) action sidebar, you need to do one of the following things:
- add a 
<div>element with the.ibexa-extra-actions-containerselector - change the selector in the Sub-items settings by sending the 
languageContainerSelectorprop which takes the selector for the element that renders thelanguageSelector.