title: Custom AddForm template with Dexterity, on Plone 4
body: <p>I'm having problems in getting my Dexterity content type to show a custom Add Form. I have already done this in a previous product, but, amazingly, I cannot accomplish this using Plone 4.1 and plone.app.dexterity 1.0.3</p>
  
  <p>My CrmContact content type, living in package.name.types.contact.py, has its schema defined in this way:</p>
  
  <pre><code>from five import grok
  from zope import schema
  from zope.interface import implements
  
  from plone.directives import form, dexterity
  
  
  class ICrmContact(form.Schema):
      """A contact item for the CRM"""
  
      title = schema.TextLine(
              title=_(u"Company name"),
      )
  
      ...
  
  class CrmContact(dexterity.Container):
      implements(ICrmContact)
  
  
  class Add(dexterity.AddForm):
  
      grok.context(ICrmContact)
      grok.name('package.name.contacts.types.contact')
      grok.template('add')
  </code></pre>
  
  <p>My template lives in package/name/types/contact_templates. It's a typical template. I know it's not being rendered because it has a dummy node that will call a non existing method using tal:content, in order to raise an exception; so I'm sure the template itself is not the issue.</p>
  
  <p>My content type FTI is registered correctly during installation, and the content type is available and addable.</p>
  
  <p>Finally, in profiles/default/types.package.name.types.contact.xml:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;object name="package.name.types.contact" meta_type="Dexterity FTI"
      i18n:domain="package.name" xmlns:i18n="http://xml.zope.org/namespaces/i18n"&gt;
  
      ...
  
      &lt;!-- Method aliases --&gt;
      &lt;alias from="(Default)" to="(dynamic view)" /&gt;
      &lt;alias from="edit" to="@@edit" /&gt;
      &lt;alias from="sharing" to="@@sharing" /&gt;
      &lt;alias from="view" to="(selected layout)" /&gt;
  
      &lt;!-- Actions --&gt;
      &lt;action title="View" action_id="view" category="object"
          condition_expr="" url_expr="string:${object_url}" visible="True"&gt;
          &lt;permission value="View" /&gt;
      &lt;/action&gt;
      &lt;action title="Edit" action_id="edit" category="object"
          condition_expr="" url_expr="string:${object_url}/edit" visible="True"&gt;
          &lt;permission value="Modify portal content" /&gt;
      &lt;/action&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>Unrelated, but maybe I have to add something here...</p>
  
  <p>I think I followed the correct procedure, as you may see, but I still cannot get it to work. </p>
  
  <p>I know class Add is getting instanced because if I provide an updateWidgets() method and insert a breakpoint, it gets called; and when I introspect the object, self.template is None; even though:</p>
  
  <pre><code>(Pdb) getattr(self, 'grokcore.view.directive.template')
  'add'
  </code></pre>
  
  <p>How can I provide a custom template to the Add Form of my custom type?</p>