This is the simple guide for creating a terribly simple config of control panel of Plone 4, most of the note is taken from here (http://plone.org/documentation/kb/how-to-create-a-plone-control-panel-with-plone.app.registry)
Assume we already have a Plone 4 package, called pure.theme
1. Create new module inside pure.theme/browser/ (let's name it: firstcpl.py) which contains configlet view, interface...:
File: browser/firstcpl.py
Define the form schema inside view interface:
your_name = schema.TextLine(title=_(u"Your name"),
description=_(u"This should be your real name"),
required=False,
default=u'',)
Define the Form class, which is subclass of RegistryEditForm:
schema = IFirstControlPanelView
label = _(u'Your misc settings')
description = _(u'Description here')
def updateFields(self):
super(FirstControlPanelForm, self).updateFields()
def updateWidgets(self):
super(FirstControlPanelForm, self).updateWidgets()
And the wrapper for control panel view:
form = FirstControlPanelForm
2. Add new entry inside the configure.zcml for the new config view:
File: browser/configure.zcml
<browser:page
name = 'pure-settings'
for = 'plone.app.layout.navigation.interfaces.INavigationRoot'
class = '.firstcplview.FirstControlPanelView'
permission = 'cmf.ManagePortal'
/>
3. Update the control panel profile (profiles/default/controlpanel.xml) to register the new configlet:
File: profiles/default/controlpanel.xml
<object name="portal_controlpanel" meta_type="Plone Control Panel Tool">
<configlet title="Pure Settings" action_id="pure" appId="pure.theme"
category="Products" condition_expr=""
icon_expr="string:$portal_url/logoIcon.png"
url_expr="string:${portal_url}/@@pure-settings" visible="True">
<permission>Manage portal</permission>
</configlet>
</object>
4. Update the registry profile (profiles/default/registry.xml) to add the new registry record(s):
File: profiles/default/registry.xml
Here we have only one record
<records interface="pure.theme.browser.firstcplview.IFirstControlPanelView" />
</registry>
After all is done, let's restart the instance and install/reinstall the package to see the new stuffs.