Customize the display of a TextField in the Admin Dashboard's ContentItem Editor?

Topics: Customizing Orchard, General
Aug 22, 2012 at 7:01 PM

Is it possible to customize the display of a TextField in the Admin Dashboard's ContentItem Editor?

For example, we have a ContentType to which we have added a TextField.

When editing an instance of the ContentType in the Admin Dashboard, the TextField is presented with a label and text input.  We would like to override the style so we can make the input box wider, and it would be nice if we could add a caption underneath the input box.

Is this possible with the TextField?  If so, how?  Thank you!

Aug 22, 2012 at 10:35 PM

If you have a module or theme that you can add a template to, then you can easily do this with alternates.  

You can use the shape tracing tool to give you a good list of options, but the one to go with would probably be something like this:  ~/Modules/YourModule/Views/EditorTemplate-ContentType-FieldName.cshtml

In that file, you can put whatever you want to replace what is normally in the default template found here:  

~/Modules/Orchard.Fields/Views/EditorTemplates/Fields/Input.Edit.cshtml

Aug 23, 2012 at 2:40 AM
Edited Aug 23, 2012 at 2:41 AM

Thanks for the tip!  That didn't quite work, but for future reference for the next person looking for an answer, here's where to look for answers: 

1. http://docs.orchardproject.net/Documentation/Alternates

2. http://docs.orchardproject.net/Documentation/Accessing-and-rendering-shapes