Disable or lock Fields

Hey All,

I have the need create an extension that will disable all the entry fields based on certain conditions.
One, which is pretty straight forward, where I would just have a button where authors with privs would be able to click and Lock/Unlock the record.

I had quickly created a field level extension the other day that has a button and just toggles disabled is true false, and then updates 0/1 into a hidden meta field (so I could persist it).

But I dont think field level is what I am looking for, as I dont think I have access to the other fields in the entry’s DOM properties.

Has anyone else done something similar that locks all the fields records, (maybe sidebar, just havent played with that enough). Are there any exposed methods that already perform this that you are aware of?

Also, eventually want to make this where only the originator of the lock or Admin can revert, or even to where select users can edit and others are locked, so this might be able to be used in conjunction with a workflow so as to prevent others from making edits on approvals in flight.

3 Likes

I am also looking for same kind of functionality.

I was able to create an entry level UI extension to do this. You do have to reimplement the fields, however there are React components using Forma36 that mimic the built in input types in Contentful.

I am trying to build a Contentful app with similar functionality: When an entry has unsaved changes by editor A it will be “locked” and cannot be edited/published by another editor until editor A is publishing it.

It really bugs me that there is no simple API function to set all fields of an entry to disabled. Also, there is no API function that disables the “publish” button either.

At least I have an idea now what I can do to disable the fields thanks to your post. Though recreating the entry seems quite cubersome.