Is there any way to set a field as read only in orchard #8461
Replies: 4 comments 4 replies
-
There is no readonly text field editor "out of the box" in Orchard. But it should be pretty simple. First look at this link. In essence you should make new textfield editor. Look at OrchardCore.ContentFields-> Views. There focus on TextField.Edit.cshtml and TextField.Option.cshtml. Copy those two views to your module and change their names to TextField-Readonly.Edit.cshtml and TextField-Readonly.Option.cshtml. In Edit view add On your content part change editor of text field. |
Beta Was this translation helpful? Give feedback.
-
You can add them in a separate module if you want to have them in a different area than your other module's views |
Beta Was this translation helpful? Give feedback.
-
I'm wondering how you can add the values for such fields. |
Beta Was this translation helpful? Give feedback.
-
This will be done from code (C#) or from the front end part itself. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to create a textbox field as readonly, is it possible using some setting or "recipe"?
Beta Was this translation helpful? Give feedback.
All reactions