I have a form branch template where I want to parse help text for specific fields with a raw filter (it contains html). The field is called a zip code in the form of Clinic
According to this http://symfony.com/doc/current/cookbook/form/form_customization.html#how-to-customize-an-individual-field
Shape Template:
{% extends 'AgriHealthAhpBundle::admin.html.twig' %} {% form_theme form 'AgriHealthAhpBundle:Form:fields.html.twig' %} {% block _clinic_postcode_row %} <div class="row"> test<div class="small-12 medium-3 columns label">{{ form_label(form) }}</div> <div class="small-12 medium-6 columns widget"> {{ form_widget(form) }} <div class="error"> {{ form_errors(form) }} </div> </div> <div class="small-12 medium-3 columns help"> {% if help is defined %} {{ help|raw }} {% endif %} </div> </div> {% endblock %} {% block admin -%} <h1>New Clinic</h1> {{ form(form) }} <div class="row form_actions"> <div class="small-12 medium-offset-3 medium-2 columns submit"> <button type="submit" id="agrihealth_ahpbundle_clinic_submit_visible" name="agrihealth_ahpbundle_clinic[submit]">Create</button> </div> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#agrihealth_ahpbundle_clinic_submit_visible').click(function(){ jQuery('form[name="agrihealth_ahpbundle_clinic"]').submit(); }); }); </script> <div class="small-12 medium-2 columns cancel"> <a href="{{ path('clinic') }}"> Cancel </a> </div> <div class="small-12 medium-2 end columns cancel"> <a href="{{ path('clinic') }}"> Back to List </a> </div> </div> {% endblock %}
AhpBundle / Resources / views / Form / fields.html.twig
{% block form_row %} {% spaceless %} <div class="row"> <div class="small-12 medium-3 columns label">{{ form_label(form) }}</div> <div class="small-12 medium-6 columns widget"> {{ form_widget(form) }} <div class="error"> {{ form_errors(form) }} </div> </div> <div class="small-12 medium-3 columns help"> {% if help is defined %} {{ help }} {% endif %} </div> </div> {% endspaceless %} {% endblock form_row %}
Anyone can see what I missed, I tried
{% block _clinic_postcode_row %}
and
{% block _clinic_postcode_row %}
Decision
In accordance with the accepted answer, the block of form lines should be fully identified with the abbreviated name of the bundle. The easiest way is to view the source code of the form and determine the text used in each input field, and the form name = "":

source share