title: Form Templates summary: Customize the generated HTML for a FormField or an entire Form. # Form Templates Most markup generated in SilverStripe can be replaced by custom templates. Both [Form](api:SilverStripe\Forms\Form) and [FormField](api:SilverStripe\Forms\FormField) instances can be rendered out using custom templates using `setTemplate`. ```php $form = new Form(..); $form->setTemplate('MyCustomFormTemplate'); // or, just a field $field = new TextField(..); $field->setTemplate('MyCustomTextField'); ``` To override the template for CMS forms, the custom templates should be located in **/app/templates**. Front-end form templates can be located in **/app/templates** or in the active theme's **/templates** directory.