File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
code_samples/back_office/subitems/timeline_view
docs/administration/back_office Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 11import TimelineViewComponent from './timeline.view.component.js' ;
22import { registerView } from '@ibexa-admin-ui-modules/sub-items/services/view.registry' ;
33
4+ // Use the existing constants to replace a view
5+ import { VIEW_MODE_GRID , VIEW_MODE_TABLE } from '@ibexa-admin-ui-modules/sub-items/constants' ;
6+
47registerView ( 'timeline' , {
58 component : TimelineViewComponent ,
69 iconName : 'timeline' ,
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ description: Inject a sub-items list into your back office customizations or cus
77The Sub-items List module is meant to be used as a part of the editorial interface of [[ = product_name =]] .
88It provides an interface for listing the sub-items of any location.
99
10- ## Add custom sub-items list view
10+ ## Create custom sub-items list view
1111
12- You can extend the Sub-items List module to add your own views to it.
13- The example below uses a timeline view to highlight the modification date.
12+ You can extend the Sub-items List module to replace an existing view or add your own.
13+ The example below adds a new timeline view to highlight the modification date.
1414
1515![ Sub-items List module using the new Timeline view] ( img/subitems/timeline_view.png " Sub-items List module using the new Timeline view ")
1616
@@ -37,6 +37,12 @@ Provide the necessary styling in `assets/scss/timeline.view.scss`. The example b
3737
3838The last step is adding the view module to the list of available views in the system, by using the provided ` registerView ` function.
3939
40+ You can create a new view by providing an unique identifier, or replace an existing one by reusing its identifier.
41+ The existing view identifiers are defined as JavaScript constants in the ` @ibexa-admin-ui-modules/sub-items/constants ` module:
42+
43+ - Grid view: ` VIEW_MODE_GRID ` constant
44+ - Table view: ` VIEW_MODE_TABLE ` constant
45+
4046Create a file called ` assets/js/registerTimelineView.js ` :
4147
4248``` js
You can’t perform that action at this time.
0 commit comments