Plone ships with a
Default address /contact-info.
Contact form files are
Inspect the files to known which you need to change. Copy these files to skin layer folder (any folder under skins) in your add-on product.
Note
Different contact for is displayed for logged-in and anonymous users. Logged in user email is not asked, but one stored in member properties is used.
Below is an example how to add "phone number" field for all not logged in users feedback form.
Add a new optional field to contact-info.cpt (language hardcoded):
<div class="field">
<label for="phone_number">
Puhelinnumero
</label>
<div class="formHelp">
Puhelinnumero, mikäli haluatte teihin oltavan yhteydessä puhelimitse.
</div>
<input type="text"
id="phone_number"
name="phone_number"
size="25"
value=""
tal:attributes="value request/phone_number|nothing"
/>
</div>
Refer this field in site_feedback_template.pt:
<div i18n:domain="plone"
tal:omit-tag=""
tal:define="utool nocall:here/portal_url;
portal utool/getPortalObject;
charset portal/email_charset|string:utf-8;
dummy python:request.RESPONSE.setHeader('Content-Type', 'text/plain;;charset=%s' % charset);"
>
<div i18n:translate="site_feedback_mailtemplate_body" tal:omit-tag="">
You are receiving this mail because <span i18n:name="fullname" tal:omit-tag="" tal:content="options/sender_fullname|nothing" />
<span i18n:name="from_address" tal:omit-tag="" tal:content="options/sender_from_address"/>
is sending feedback about the site administered by you at <span i18n:name="url" tal:replace="options/url" />.
The message sent was:
<span i18n:name="message" tal:omit-tag="" tal:content="options/message | nothing" />
</div>
--
<span tal:replace="portal/email_from_name" />
</div>
Puhelinnumero: <span tal:content="request/phone_number|nothing" />
Note
As a crude hack we add new field to the very bottom of the email, as everything side <div i18n:translate> is replaced from translation catalogs.
Sometimes you want to turn off the builtin form in favour of a piece of content. For example you might want a PloneFormGen form that content editors can alter. Naming your content item contact-info works because Zope traversal will find your content item before the page template. However Plone won't allow a new piece of content to be named contact-info since that's a reserved identifier, so the trick is to rename it in the ZMI from the Plone-generated contact-info-1 back to contact-info.
This works for accessibility-info too.
If you have a PFG contact form at, say, about/contact-us and want to turn off the builtin contact-info form, use the rename trick to create a contact-info Link object at the site root that points to your new form. Through acquisition, even URLS like events/contact-info will successfully redirect to your custom form.
The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.
For basic information about updating this manual and Sphinx format please see Writing and updating the manual guide.