We are able to force whether the selected content control should be locked or unlocked.
The module is located here:
...\ModuleLibrary\BaseExtensions\04_nocontext_MISC\12b_W_forceContentControlLocking.xml
CMD:
The following command forces the selected content control to either lock or unlock its content. This will be defined in the parameters below. Both of them need to be present in the command.
<Cmd case="BaseExtensions:ForceContentControlLocks"/>
Parameters
CanNotEdit
Define whether the command should disable the ability to edit content in the selected content control. Set this parameter to be true
if the command should lock any editing in the content. If false
, the user will be able to edit the content control.
CanNotDelete
Define whether the command should disable the ability to delete content in the selected content control. Set this parameter to be true
if the command should lock for deleting the content. If false
, the user will be able to delete content.
Example: Lock named content control
<Button label="Lock Named CC">
<Cmd case="BaseExtensions:select-named-cc" name="CCTitle" onlyContent="false"/>
<Cmd case="BaseExtensions:ForceContentControlLocks" CanNotEdit="true" CanNotDelete="true" />
</Button>
The onlyContent
parameter in the first command is required to make it work.
Lock all content controls by name
CMD:
The following command forces all the content controls with the same name in the document to either lock or unlock its content.
<Cmd case="BaseExtensions:ForceContentControlLocksByName"/>
Parameters:
cc-name
Define the name of the content control to be locked or unlocked.
can-not-edit
Define whether the command should disable the ability to edit content in the selected content control.
can-not-delete
Define whether the command should disable the ability to delete content in the selected content control.
Set both these parameters to be true
if the command should lock for editing / deleting the content. If false
, the user will be able to edit/delete content.
Example:
<Button label="Lock all by name"> <cmd case="BaseExtensions:ForceContentControlLocksByName" cc-name="ProjectTitle" can-not-edit="true" can-not-delete="true"></cmd> </Button> <Button label="unlock all by name"> <cmd case="BaseExtensions:ForceContentControlLocksByName" cc-name="ProjectTitle" can-not-edit="false" can-not-delete="false"></cmd> </Button>
Comments
0 comments
Article is closed for comments.