Skip to content

Commit

Permalink
adding more doc about zmi customiziation
Browse files Browse the repository at this point in the history
  • Loading branch information
drfho committed Sep 19, 2023
1 parent 14a5e0a commit 1619125
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Products/zms/zpt/ZMSContainerObject/manage_main.zpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
data-root python:here.getRootElement().getHome().id;
data-client python:here.getHome().id;
data-level python:here.getLevel();
data-type python:here.attr('attr_dc_type') or nothing;
id python:'zmsid_%s'%(here.id);
class python:here.zmi_body_class(id='properties')">
<header tal:replace="structure python:here.zmi_body_header(here,request)">zmi_body_header</header>
Expand Down
13 changes: 13 additions & 0 deletions docs/develop_api_exampels_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,16 @@ body.ZMSAuthor_special .zmi-action .dropdown-menu a.dropdown-item[title='ZMSLink
}
```
For the ZMSAuthor the CSS snippet hides all the menu items besides "ZMSFile" and "ZMSLinkElement".

### Other Attributes for Customizing the ZMI
As an alternative to the ZMS-Action *manage_css_classes* the meta-attribute `attr_dc_type` can be used to add a specific style to the ZMI. The attribute value will be added as a CSS-class systematically as `data-type`- attribute to the body-element of the ZMI. This is useful if the CSS-class is static and does not need to be changed by the ZMS-User.

```css
body[data-type='News'] .zmi-action .dropdown-menu a.dropdown-item {
display:none;
}
body[data-type='News'] .zmi-action .dropdown-menu a.dropdown-item[title='News-Article'],
body[data-type='News'] .zmi-action .dropdown-menu a.dropdown-item[title='ZMSFolder'] {
display:block;
}
```

0 comments on commit 1619125

Please sign in to comment.