Plone 4.0: FormGen Mailer Template Fields

I am customizing a form mailer template and would like the fields in my email template to be grouped by their fieldsets, and also include the fieldset title. Is that possible to do? Thank you in advance. I am a new user to Plone. My current template is:

:


            

3 stages of customization:

  1. try to reach your goal using CSS
  2. modify the DOM using Javascript/jQuery as needed
  3. customize the related templates/.pt files using z3c.jbot

I would pick a method of customisation in this order of preference

  1. CSS
  2. Diazo
  3. Theme fragments (doesn't work for everything since you can't get access to the rendered html)
  4. JS (issues with conflicting JS, browser changes and no progressive enhancement)
  5. jbot (problems when upgrading plone verisions that whole underlying pages might have changed)

That's odd. My template was included in the original post, but is not there now. While I appreciate everybody who has responded, I am pretty new to Plone development. The template in the form mailer is below. Is there a specific field value that I would add for a fieldset field to show? Thank you again.

 This is the code in the mailer:
    <table border="0" cellpadding="8" cellspacing="0" width="100%">
        <tal:block repeat="field options/wrappedFields | nothing">
            <tr>
             <td tal:content="field/fgField/widget/label" /> 
            <td tal:content="structure python:field.htmlValue(request)" />
            </tr>
        </tal:block>
    </table>

Even the docs say this is a complicated question!

https://docs.plone.org/working-with-content/managing-content/ploneformgen/getting_started.html#template-encryption-overrides

I would be trying to inspect what is in the field variable, whether it contains information about the fieldset it belongs to. I'm not entirely sure how I would do that; it would require poking through the source code to figure out the class, etc.

Perhaps someone else has already posted examples of customized mailer templates?

It's also possible that whatever invokes the mailer template has other variables that you could read from, but again it would require some poking at the source code, in https://github.com/smcmahon/Products.PloneFormGen/

You can hard-code the fields, maybe something like this:

    <div class="group1">
         <span tal:content="some_field/fgField/widget/label" /> 
        <span tal:content="structure python:some_field.htmlValue(request)" />
   </div>
    <div class="group2">
        <p tal:content="structure python:some_field.htmlValue(request)" />
   </div>
2 Likes

Bjorn: Thank you. I was looking for a way to hard code this in. I will test this to see how it works for my situation. Camille