Force locking of content control

Modified on Mon, 5 Oct at 1:54 PM

We are able to force whether the selected content control should be locked or unlocked.

The module is located here:

Code
...\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

XML
<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:

XML
<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>

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article