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'); Both `MyCustomTemplate.ss` and `MyCustomTextField.ss` should be located in **mysite/templates/forms/** or the same directory as the core.