Athento allows creating a custom panel in the documents view to display fields and categories in read-only modes.
IMPORTANT: When a custom panel is added, the rest of the usual panels in the
document must also be added. New panels must be added by indicating in the
"Panel type" field the type we want to add.
To do this, go to the administration and create a new custom panel for the form (Home > Doctypes > Document panels).
The following parameters must be specified:
- Panel type: custom.
-
Template: file_card_metadata_panel_one_column_ro.html (metadata panel with one column where metadata are displayed in read-only mode).
- Other templates depending on the number of columns:
- file_card_metadata_panel_two_columns_ro.html (2 columns of metadata in read-only mode)
- file_card_metadata_panel_three_columns_ro.html (3 columns of metadata in read-only mode)
- file_card_metadata_panel_two_columns_ro.html (2 columns of metadata in read-only mode)
- Other templates depending on the number of columns:
-
Template parameters:
{"metadatas": ["<metadata_name_1>", "<metadata_name_2>", ...], "metadata_categories": ["<category_slug_1>", "<category_slug2>"]}In the “metadatas” key, a list of the names (“name” attribute) of the fields to be displayed is specified (the order of the list will be preserved). In the “metadata_categories” key, a list of the “slug” attribute of the categories to be displayed is specified (the order defined to display the categories will be preserved). For the categories, all metadata will be displayed.
Once defined, a panel will be displayed in the document view with the fields and categories defined in read-only mode.
Example of the “Initial data” panel using a template with two columns, and “Custom panel 1” with a one-column template: