Hiding a content block by using a script in the Condition field will also hide any blocks placed below it.
Steps to Reproduce
Create a new content_block_static record with the following information (also shown in the attachment):
- Category: General
- Conditional: Checked
- Condition: gs.getSession().hasRole('admin');
Add this this block to the ITIL Homepage so that it has content blocks above and below it.
View the homepage while logged in as the System Administrator.
Note that the block shows as expected.
Impersonate an ITIL user that does not have the admin role.
View the ITIL Homepage again.
The content block is not visible and all elements below the block are also hidden.
This is expected behaviour. The condition field of a CMS content block is meant to work on CMS pages, not Home pages. While some CMS widgets may run on Home pages be aware they were not developed for Home pages but for CMS pages.
Content Blocks were designed for Content Pages (CMS), not for Home Pages. Although they might work on home pages, it is recommended not to use them on Home Pages, as this is not supported.
Since Helsinki, Responsive Dashboards can be used. Like Home Pages, these do not support some Content Blocks features, and we do not plan on supporting them, as Dashboards are not CMS Content Pages.
It is not recommended to rely on the content block condition field, because it will make difficult migrating to Dashboards, which rely on proper ACLs to grant access to content instead of condition expressions.
Related Problem: PRB648998