Trainings on how to create your own website using Plone 6 is available as part of the Plone training at https://training.plone.org.
- Python 3.7, 3.8, 3.9
- Python python-venv and python-dev
- Node 16 / Yarn (See https://6.dev-docs.plone.org/volto/getting-started)
- Libraries
- libz
- libjpeg
- readline
- libexpat
- libssl or openssl
- libxml2
- libxslt
Note If you already have a higher version of python on your system, replace python3.8 with your installed version bellow
apt update
apt install python3-venv python3.8-dev python3.8-venv git make gcc
Optionally set default python3:
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
brew install zlib git readline jpeg libpng libyaml
In order to develop Plone 6 backend add-on run:
git clone https://github.com/eea/eea.facetednavigation
cd eea.facetednavigation
make
make start
To use other Python version run make with -e parameter:
make -e PYTHON=python3.8
make start
To use other Plone version run make with -e parameter:
make -e PLONE_VERSION=5.2.9
make start
CSS and JS static resources are automatically built on make start but you can always manually rebuild them by running:
yarn
yarn build
See the resources directory if you need to add or remove CSS/JS resources.
See webpack.config.js and package.json for the static resources input/output options.
Run:
make develop
We recommend using Visual Studio Code Editor
- Extensions:
- Remote Development - Windows only
- Python
- Open Visual Studio Code and click File > Open Folder
- Browser your computer and select eea.facetednavigation
- Within the Explorer open
eea > facetednavigaton > interfaces.pyand typefrom zope.component import query. If you get the auto-complete options, you're done. - Happy hacking!
Note Hot reload is not available for Plone backend development, thus you'll have to restart Plone after you edit Python code. Still, there are options to reload your changes without restarting Plone, by using plone.reload and dm.plonepatches.reload. Go to http://localhost:8080/@@reload admin:admin
See also: Debugging Plone in Visual Studio Code
If you depend on events from Faceted Navigation within your code, make sure you use the correct "depends":
<records interface="Products.CMFPlone.interfaces.IBundleRegistry"
prefix="plone.bundles/your-pkg">
<value key="enabled">True</value>
<value key="jscompilation">++plone++your-pkg/build/your-pkg-remote.min.js</value>
<value key="load_defer">False</value>
<value key="load_async">False</value>
<value key="depends">faceted.jquery</value>
</records>
Now you should be able to execute your code, for example, after the Faceted Navigation (with results - AJAX_QUERY_SUCCESS) has loaded.
$(window.Faceted.Events).bind(window.Faceted.Events.AJAX_QUERY_SUCCESS, function () {
// Your code
});
Note Replace Ctrl with Cmd key on MacOS
- Ctrl+Shift+P Trim Trailing Whitespace
- Ctrl+Shift+P Sort imports
- Ctrl+click on a
class / importto go to definition
You can manually run test in terminal, like:
bin/zope-testrunner --test-path eea
Or via Visual Studio Code
- Go to
Run > Start Debugging (F5)and selectTest Plonedebugger.
If you want to cleanup your development environment and start from scratch just run:
make clean
The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.
See LICENSE.md for details.