Replies: 16 comments 2 replies
-
There’s a plugin for it https://plugins.craftcms.com/incognito-field |
Beta Was this translation helpful? Give feedback.
-
@Sam-Black-0013 Is that plugin relatively similar to what you’re looking for? |
Beta Was this translation helpful? Give feedback.
-
Yub it is, thanks. But can't it be added as a core feature in fields ? |
Beta Was this translation helpful? Give feedback.
-
@Sam-Black-0013 Just making sure we’re on the same page. There are lots of similar enhancements planned for Craft 4.0 so I will make a note of this for that. |
Beta Was this translation helpful? Give feedback.
-
AWW @brandonkelly u guys are the best >.< |
Beta Was this translation helpful? Give feedback.
-
I would find it handy if there could be readonly setting on fields by user roles. Like if admins/devs could edit the field from the CMS without changing the field type from readonly to editable, but it would always be readonly for everyone else. |
Beta Was this translation helpful? Give feedback.
-
Craft 3.5 has a new field layout designer, which includes the ability to add additional UI elements, including one that pulls in a site template of your choosing. So you can use that to put whatever arbitrary HTML you want in your field layout, which I’d say resolves this. |
Beta Was this translation helpful? Give feedback.
-
Brandon, I think you misunderstood the feature request. The idea is to be able to configure regular fields’ visibility on edit pages. Ideally this would work with every field type, and configuration would be per field layout. The Incognito field plugin solves this for plain text fields only. Visibility can be configured dynamically using Twig. {{ currentUser.isInGroup('editors') ? 'readonly' : 'hidden' }} https://github.com/mmikkel/IncognitoField-Craft3#overriding-the-rendering-mode-with-twig-logic |
Beta Was this translation helpful? Give feedback.
-
There hasn’t been any mention of toggling field visibility here, just writability. Toggling field visibility based on user groups is covered by #947. I interpreted the issue as requesting a field-level “Read-only” checkbox – not something that could sometimes be writable, sometimes not, depending on a condition. At which point, it would be better to just not have a field in the first place, and use a Template UI element in the field layout. But can reopen if I was mistaken. |
Beta Was this translation helpful? Give feedback.
-
Ah ok, that’s how you read it! I don’t see the purpose of a field that’s not writeable at all, so I assumed the issue is about its rendering in the control panel. Content would be written to it in other ways, from front end forms, or programatically. #947 is pretty much covering my intepretetion of this request. |
Beta Was this translation helpful? Give feedback.
-
Yeah good point. I’ll go ahead and reopen on the assumption that the request is for sometimes-read-only fields. |
Beta Was this translation helpful? Give feedback.
-
We are also looking for this feature. In some projects we have data that is coming from an external source into Craft using Feed Me. Now we hide those fields for certain User Groups so they would not accidentally edit the data in Craft and after a new feed run gets overwritten. Now we would like the ability to add a Readonly condition so the fields are still visible but not editable for certain User Groups. That way the data is still viewable but they won't be able to manipulate it in Craft. |
Beta Was this translation helpful? Give feedback.
-
This came up with regards to my Code Field plugin, FWIW: nystudio107/craft-code-field#15 Rather than implement it just for this field, I do think it would be useful to be baked into Craft at some point, with user-level permissions for the field. Craft could use the |
Beta Was this translation helpful? Give feedback.
-
Related: #14015 |
Beta Was this translation helpful? Give feedback.
-
In the Field Layout (of an Entry Type) you can set a field to be required. |
Beta Was this translation helpful? Give feedback.
-
I'm interested in this being added to core Craft, is there any plans for this to be added? |
Beta Was this translation helpful? Give feedback.
-
Description
I think Craft would be more awesome and more handsome if it allowed me to mark some fields as read-only. just a small checkbox in the field's settings 😽
Beta Was this translation helpful? Give feedback.
All reactions