For example, you have a user named 'test'. And this user is Administrator, but you want this user to only be able 'add/edit/remove' content, without making content public.
Form-view in backend is handled via 'couch/theme/my/content_form.html' snippet (Note, that I already enabled a custom admin theme in config.php and copied snippet from '_system' theme to 'my' theme).
So, in this snippet, we will modify the code saving any cloned page to also make it 'unpublished'. So, whenever user 'test' adds a page, edits it - it will always become 'unpublished'.
Default piece of the snippet is
- Code: Select all
<cms:db_persist_form
_invalidate_cache='1'
_token=k_cur_token
/>
And the subtle change is as follows:
- Code: Select all
<cms:if k_user_name eq 'test' && k_template_is_clonable>
<cms:db_persist_form
_invalidate_cache='1'
_token=k_cur_token
k_publish_date = '0000-00-00 00:00:00'
/>
<cms:else />
<cms:db_persist_form
_invalidate_cache='1'
_token=k_cur_token
/>
</cms:if>
Now, you also don't want 'test' user to view Advanced Settings where the publish date is present.
Change will go to this piece:
- Code: Select all
<!-- advance settings dropdown -->
<cms:render 'group_advanced_settings' />
And it becomes
- Code: Select all
<cms:if k_user_name ne 'test'>
<!-- advance settings dropdown -->
<cms:render 'group_advanced_settings' />
</cms:if>
As a result of these changes, only 'test' can't manage the dates, other Administrators and Super-admin can log in and make pages published.
Reviewer/ Approver
A very similar approach can be used. Each page could have an extra editable checkbox - 'Approved', visible only to certain users.
publishing control - immediately / schedule for later.
If 'Approved' checkbox is checked, then a certain user can have 'Advanced Settings' visible, where date of publish can be set either in present or in future (therefore it is scheduled for later date).