Orchard overriding customform textarea template

How to override/create customform textarea template?

Using Orchard 1.8. In order to style a custom form I wish to addclass to the fieldset tag wrapping the textarea. Using the shapetracer it is not clear to me

(I can override other tags for example the 'boolean field types. (E.g copy Modules/Orchard.Fields/Views/EditorTemplates/Fields/Boolean.Edit.cshtml to Views/EditorTemplates/Fields/Boolean.Edit.cshtml) but unsure for textarea. (copying Input.Edit.cshtml doesnt work it appears.)

Upvotes: 1

Views: 474

Answers (2)

Alan Cherney
Alan Cherney

Reputation: 21

You can override the TextArea by copying the file ~/Core/Common/Views/Body.Editor.cshtml to a location of higher priority (like ~/Themes/MyTheme/Views/Body.Editor.cshtml) and editing it there. However, that cshtml file handles more than just TextArea type - it would override the rendering of all body editors. To be specific to just textarea, you should create a file named Body.Editor-TextArea.cshtml

Upvotes: 2

ErMasca
ErMasca

Reputation: 741

Usually, i just override the whole HTML. You know the names/ids right? so you can easily copy the HTML from the ShapeTracer and copy in your new Alternate.
While the name/ids stay the same, everything will wire up properly.
Check your "EditorTemplate", but before creating and alternate, copy the HTML instead of the Template.

Upvotes: 0

Related Questions