Articles Field

Article field as read-only in article edit form

4 months 5 days ago #89645

Octav A's Avatar Octav A

Hello,

I have a set of article fields that once set will never change, but is possible to accidentally edit them by user. Please advise how to make certain Article Fields as readonly in article edit layout so as to be visible but not editable.
Thanks.

4 months 5 days ago #89646

Peter van Westen's Avatar Peter van Westen Admin

How the custom field shows up in your frontend editform is outside the scope of the field (Articles Field) itself.

Joomla has no built-in option to set fields as read-only in the frontend form.

You can probably do this via template overrides and conditionally show the normal form field or just the output. Where you check if the view is frontend or admin (or based on the access level).

Coding that is beyond my support.

4 months 5 days ago #89647

Andrea Malalana's Avatar Andrea Malalana Moderator

I believe you can actually do that by:
- Making the field as editable only by Super-Admin in the "Permissions" tab.
- Under the "Options" tab set "Display when Read-Only" to "Yes".

This should make the field input visible to every user but nobody (except you) will be able to edit it.

4 months 5 days ago #89648

Octav A's Avatar Octav A

What about back-end edit form, this is where i need to make it readonly?

4 months 5 days ago #89649

Andrea Malalana's Avatar Andrea Malalana Moderator

Same thing. The Read-Only is based on Permissions. If you want nobody to be able to edit it, then in the Permission Tab don't give permission to anybody in the option "Edit Custom Field Value".

4 months 5 days ago #89652

Peter van Westen's Avatar Peter van Westen Admin

Oh 😁

4 months 5 days ago #89653

Octav A's Avatar Octav A

I have tried already that. and forbidden Superuser also (i need that nobody can edit). I guess is not possible to make Superuser not able to edit the field? Please confirm this.
Andy Badwool wrote:

Same thing. The Read-Only is based on Permissions. If you want nobody to be able to edit it, then in the Permission Tab don't give permission to anybody in the option "Edit Custom Field Value".

4 months 5 days ago #89654

Andrea Malalana's Avatar Andrea Malalana Moderator

Yep looks like no way to stop Super Users to edit. They're Super Users, they can do what they want 😁

4 months 5 days ago #89655

Octav A's Avatar Octav A

All clear. Thanks for clarification and your time.