The 5.7 branch of Magnolia reached End-of-Life on December 31, 2023, as specified in our End-of-life policy. This means the 5.7 branch is no longer maintained or supported. Please upgrade to the latest Magnolia release. By upgrading, you will get the latest release of Magnolia featuring significant improvements to the author and developer experience. For a successful upgrade, please consult our Magnolia 6.2 documentation. If you need help, please contact info@magnolia-cms.com.
Content view definition
A content view must implement
The configuration snippet below shows content view definitions for the Magnolia provided implementations for JCR based data for tree, list, thumbnail and search.
Node name | Value |
---|---|
tree | |
class | info.magnolia.ui.workbench.tree.TreePresenterDefinition |
sortable | true |
columns | |
list | |
class | info.magnolia.ui.workbench.list.ListPresenterDefinition |
columns | |
thumbnail | |
class | info.magnolia.ui.workbench.thumbnail.ThumbnailPresenterDefinition |
search | |
class | info.magnolia.ui.workbench.search.SearchPresenterDefinition |
columns |
contentViews: - name: tree class: info.magnolia.ui.workbench.tree.TreePresenterDefinition columns: &myColumns - name: jcrName editable: true sortable: true propertyName: jcrName class: info.magnolia.ui.workbench.column.definition.PropertyColumnDefinition - name: status width: 45 displayInChooseDialog: false formatterClass: info.magnolia.ui.workbench.column.StatusColumnFormatter class: info.magnolia.ui.workbench.column.definition.StatusColumnDefinition - name: moddate width: 160 sortable: true displayInChooseDialog: false formatterClass: info.magnolia.ui.workbench.column.DateColumnFormatter propertyName: mgnl:lastModified class: info.magnolia.ui.workbench.column.definition.MetaDataColumnDefinition - name: list class: info.magnolia.ui.workbench.list.ListPresenterDefinition columns: *myColumns - name: thumbnail class: info.magnolia.ui.workbench.thumbnail.ThumbnailPresenterDefinition - name: search class: info.magnolia.ui.workbench.search.SearchPresenterDefinition columns: *myColumns
The YAML example shows more details compared to the JCR tree definition. Note how the column definition from the tree view has been reused for the list and the search views.
Common content view properties - ContentPresenterDefinition properties
| required A presenter definition class extending $webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources")
ContentPresenterDefinition
to define the type of the view. |
columns | required (not used for thumbnail view) |
| optional , default is no drag-and-drop capability A drag-and-drop constraint class. By restricting the nodes that a user can move you can enforce a certain node hierarchy. For example, you might want to allow moving of content under folders but not folders under content. If the class is not defined, the view will have no drag and drop capability. When you write your own class, implement the $webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources")
DropConstraint
interface. |
| optional Makes the workbench editable inline. You can double-click a cell to edit its value. Inline editing is available only in the tree view, not in list, thumbnail or search views. Definining a default action will override inline editing. Double-clicking the cell with trigger the default action instead of inline edit mode. |
icon | optional CSS class that identifies an icon used on the view tab. For available names see Icons. |
active | optional , default is Defines whether the view is active. |
TreePresenterDefinition additional properties
| optional, default is Enables and disables sorting of items in the view. Click the column header to sort. |