How to get started with Plone development.
- Installing Plone
- Non-programming approaches for customizing Plone
- Enabling debug mode
- Plone add-ons as Python packages
- Finding and installing add-on packages
- Creating your first add-on
- Plone development workflow
- Plone add-on features
- Development mode restarts
- Through-the-web customizations
- Hello World Tutorial
- Plone resources
- Zope resources
- Python resources
- Debug mode explained
Plone is developed in the Python programming language. You should master Python basics before you can efficiently customize Plone. If you are very new to Python, Plone or software development, it is suggested that you read the Professional Plone 4 Development book before you attempt to develop your own solutions.
If you quickly want to learn about current best-practices in developing with Plone you should also work through the Todo list application tutorial.
Plone runs on the top of the Zope 2 application server, meaning that one Zope 2 server process can contain and host several Plone sites. Plone also uses Zope 3 components. Zope 3 is not an upgrade for Zope 2, but a separate project.
Internally, Plone uses the objected-oriented ZODB database and the development mindset greatly differs from that of SQL based systems. SQL backends can still be integrated with Plone, like for any other Python application, but this is a more advanced topic.
It is recommended that you do Plone development on Linux or OS X. Development on Windows is possible, but you need to have much more experience dealing with Python and Windows related problems, so starting on Windows is not so easy.
See installation instructions for how to create a Plone installation suitable for development.
If you lack programming skill or resources, you can still get some things done in Plone:
- Plomino is a a powerful and flexible web-based application builder for Plone
- PloneFormGen allows you to build forms in a web browser
- Plone 4+ comes with through-the-web Dexterity content type editor
By default, Plone runs in a production mode where changed files in the file system are not reflected in the served HTML. When you start developing Plone you need to first put it into a debug mode.
Plone sites can be customized by installing Plone add-ons, which add or customize functionality. You can install existing add-ons that others have developed or you can develop and install your own add-ons. Add-ons are developed and distributed as Python packages. Many open-source Python packages, including Plone add-ons, are available from PyPI (the Python Package index).
Plone uses a tool called Buildout to manage the set of Python packages
that are part of your Plone installation.
Using Buildout involves using the
buildout.cfg configuration file and the
In prior versions of Plone and Zope, add-ons were referred to as "products" and they were installed by copying
them into a special folder called
products. This method is now deprecated in favor of using
standard Python packages, managed by Buildout.
See the Installing add-on packages using buildout section for more details.
Since Python egg package structure is little bit complex, to get started with your first add-on you can create a code skeleton (scaffold) for it using Plone ZopeSkel code templates.
- ZopeSkel generates a basic Python egg package with some Plone files in-place.
- This package is registered to buildout as a development egg in the
- Buildout is rerun which regenerates your
bin/instancescript with the new set of Python eggs.
- You start your Plone instance in debug mode.
- You install your add-on through
There are different scaffolds for different kind of add-ons. The most typically used are
archetype (create Archetypes content),
dexterity (create Dexterity content) and
(barebone Plone add-on).
Please read how to use ZopeSkel to bootstrap your first add-on.
If you want to create a package with Dexterity content types please read about Setting up a Dexterity project.
You never edit Plone files directly. Everything under
folders in your Plone installation is downloaded from the Internet and dynamically generated by Buildout,
buildout.cfg. Buildout is free to override these files on any update.
You need to have your own add-on in the
src/ folder as created above.
There you overlay changes to the existing Plone core through extension mechanisms provided by Plone:
Plone development always happens on your local computer or the development server. The changes are moved to production through version control system like Git or Subversion.
The best practice is that you install Plone on your local computer for development.
Plone add-ons usually:
- Create custom content types or extend existing ones for your specialized need. Plone has two subsystems for <content types: Dexterity (new) and Archetypes (old).
- Add new views for your site and its content.
- Create Python-processed forms on your site.
- Theme your site
A lot of Plone functionality is built on Zope 3 development patterns like adapters and interfaces. These design patterns take some time to learn, but they are crucial in complex component based software like Plone.
Plone must be started in the development mode using
bin/instance fg command. Then
- CSS files are in debug mode and automatically loaded when you hit refresh
- TAL page templates (.pt files) are automatically reloaded on every request
- GenericSetup XML files are reloaded
Please note that Plone development mode does not reload
.zcml files by default.
This is possible, however. Use the sauna.reload package
to make Plone reload your Python code automatically when it is changed.
Some aspects of Plone can be changed through the Zope Management Interface (ZMI). Documentation here does not focus on extending functionality through the ZMI because this method is severely limited and usually can take you only half way there.
We have a tutorial introducing the basics of Plone development.
The tutorial covers a basic form, a custom content-type, and a dynamic view. It also has detailed sections on building a development environment, installing Plone, and creating an add-on package for your development code.
Zope 2 book. This describes old Zope 2 technologies. The book is mostly good for explaining some old things, but '''do not''' use it as a reference for building new things.
The chapters on Zope Page Templates however are still the best reference on the topic.