Weblog
David Glick: Cookieplone
Talk by David Glick at the Plone conference 2024 in Brasilia.
Link to talk information on Plone conference website.
Cookieplone is a project generator for Plone. It has several templates to choose from: backend add-on, frontend add-on, project with both.
It is recommended for Volto 18 with Plone 6.0 or 6.1.
See the Plone documentation.
A brief history of Plone installers. What makes a good installer? Minimal: you don't want to need to install a bunch of things before you can use the installer. Reliable: works each time. Portable: works on your laptop and the server, Linux and Mac (and Windows hopefully). Easy to use, batteries included, flexible. Both easy to use and flexible can be hard to get right.
Why can't you just run `pip install Plone`? You can, then you have the Python packages. But then you need scripts, configuration, add-ons, databases, maintenance jobs, a front-end, etc.
Long time ago: download a tarball and unpack it. No dependency management.
Buildout came along, this handled dependency management, could create configuration and scripts using recipes. It has served us well. It has a bit of a learning curve. The reliability and portability could be a problem, especially when the server would be different from your laptop, or you did not pin all versions, or a package could no longer be downloaded.
Then we had the Unified Installer and Windows Installer. It was a wrapper around buildout, including all the needed packages and some scripts to make sure you had the right prerequisites.
plonecli / bobtemplates were more in the area of project scaffolds.
Somewhere in the past decade it become possible to install Plone with pip.
You can use Docker to install Plone. Less useful for development.
cookiecutter-plone-starter was the way to start with Volto and Plone 6. It would give you a Plone backend package and run a separate command to generate a Volto frontend.
And this year cookieplone. It was born in May this year during the Axolote sprint in Mexico City.
What is new compared to cookiecutter-plone-starter?
- It is a mono repo for frontend and backend.
- There are now minimal differences between an add-on and a project.
- We now use pnpm-workspaces for the frontend, which helps if you want to try an unreleased version of a package like Volto.
How does it work? It is a wrapper around Cookiecutter, running several templates, and then some actions at the end: modifying some files or deleting files that you don't want. It has custom filters.
What if I prefer Buildout, or don't want Volto, prefer unittest over pytest? Partial answer: cookieplone is opinionated, so no. But we can talk about it. You can contribute. You can also fork it if your company has different opinions.
It is expected that the templates will evolve over time. We will fix bugs or do things differently. How can I update an existing project? You could generate a new one and then copy in the custom parts that you already have.
What's in progress:
- GitLab pipeline
- Support for bob templates has recently landed, with some commands to extend an already generated project.
- Add a documentation section in the generated project.
- Option to create a Plone distribution.
- Use
hatch
for the backend. - Run via web-based UI or GitHub code spaces.
Plone Foundation membership meeting
Plone Foundation membership meeting at the Plone conference 2024 in Brasilia.
The Plone Foundation is a non-profit organization that exists to protect and promote Plone. We have an open annual meeting of the membership during the Plone conference. Some links:
- membership meeting 2024
- board of directors
- The annual report should be available there too in the future.
Currently 92 active members from 22 countries. This year 45 new contributors really contributed to the Plone code repositories. We had Daniel, Mohammad and Ziming as Google Summer of Code students.
This week we had an election for board members, all four candidates have been chosen for a period of two years: Brian Davis, Gouveia, João Henrique, Martin Peeters, Rafahela Bazzanella. Thank you to Paul Roeland and Kim Paulissen for their service on the board. The other existing board members stay for another year.
Mikel Larreategi: Multilingual Plone & Volto
Talk by Mikel Larreategi at the Plone conference 2024 in Brasilia.
Link to talk information on Plone conference website.
In our region we have Basque, Spanish and French as languages, with different official rights. So a multilingual approach is important.
Basic options that you have in Plone are to set a default language and other available languages. then you get a language switcher at the top of the page to choose the language of the UI. This is useful when you have basic needs.
You can also activate the multilingual add-on. This gives more options for multilingual content. For each language, a folder is created automatically and the user interface is shown in the language of that folder. This is useful when you have most content in the main language and then have secondary languages.
You can force using an admin language for the UI using the https://github.com/miohtama/silvuple add-on.
You can also choose real multilingual content: link all translations, for example go to a Spanish news item, select Basque as language, and you are redirected to the Basque version of this same news item.
Of course an editor needs to create the translations of those pages. In the toolbar (Classic UI) are extra options for adding a translation or linking existing content as a translation. When editing, you can use the "babel view" to see the original language on the left and the editable language on the right.
The translated pages are not special items: a translated news item is still a news item, not something special. You can move it, rename it, workflow it, etc.
You can link to the same content in all languages: there is a multilingual link that is shown in the toolbar. In the html head of the page, there are links to the other languages. This is useful for search engines.
If as a visitor you go to a Plone multilingual site for the first time, Plone accesses the language-switcher view. This looks at the Accept-Language header, at an I18N_LANGUAGE cookie, or falls back to the default language.
There are some glitches and problems for SEO. Language change urls are not direct. Sometimes Plone keeps showing a `?set_language=XX` parameter in the url, leading to duplicately indexed content.
How about Volto? You need to configure the backend as you would do in Classic UI. In the Volto config you need to add some settings, like `isMultilingual = true`.
Can we use automatic translation? Yes, there is an integration with Google Translate. You need to get an API key for that from Google, then it is available in the babel translate view. And in Volto? You can use ecityclic.google_translate.
This can work for Spanish, but in Basque the automatic translations are not so good. There are some external services you could use. We made a pull request to improve this.
There is an add-on with which you can force an admin language in case you deal with some languages that you really can't read: https://github.com/miohtama/silvuple or its update for more recent Plone versions: https://github.com/codesyntax/cs.adminlanguage
Lightning talks Wednesday
Lightning talks on Wednesday at the Plone conference 2024 in Brasilia.
Érico Andrei: PyTour 2024
There were five Python conferences in Brazil this year. Six with this one. If you visited all of them, that is more than 12 thousand kilometers. Two heroines visited them all!
Alexander Loechel: Secure your keys
You should only use key-based authentication for accessing servers via ssh. Use ssh-fido or ssh-resident keys. Don't store them on your machines. Get hardware keys. You can check with a command if your server supports these keys.
Alin Voinea: EEA and Plone
The EEA, European Environment Agency, is using Plone since at least 2006. In 2019 we jumped into Volto, Plone 6 in 2023, this year Volto 17.
We have 74 PyPI add-ons and 119 NPM add-ons, around 400 Docker images and 900 repositories on GitHub.
EEA has a design system, see https://eea.github.io/volto-eea-design-system/. That makes them not always work with the Volto Light Theme, but talk with us and we can look.
We use generative AI with Volto-chatbot to generate answers from all our Plone sites.
Kim: Plone user guide
Plone's user guide was written for Plone Classic. We wanted an updated version for the training: https://plone.org/userguide
This was done with https://scribehow.com/, a paid service. Can export to PDF, html.
Breno Brito: Speed run coding with AI
Demo. Prompt: make a beautiful to do app with Python and Flask.
Belisa: Eu te amo, pandas
I love you, pandas. I am working with some Brazilian data in an Excel file with 188 thousand rows. I import them using pandas
and polars
and compare how they do. With polars it takes 12 seconds to import. With pandas... still busy, so let's sing some karaoke. So I love you, pandas, but...
Mikel Larreategi: Translations
Plone translations are in the plone.app.locales package: https://github.com/collective/plone.app.locales/
Most translations in Volto also come from this package. Some specific translations are in Volto itself.
In the readme of plone.app.locales you can see a graph that shows how much in your language is translated. You can clone the repo and edit, or use online Weblate: https://hosted.weblate.org/projects/plone/
The documentation is here: https://6.docs.plone.org/i18n-l10n/contributing-translations.html
Piero Nicolli: Bring your own front-end
Talk by Piero Nicolli at the Plone conference 2024 in Brasilia.
Link to talk information on Plone conference website.
Volto is already almost ten years old. Things are moving in the frontend world.
We had a client request for something specific for tourists, with native look and feel, PWA support, multilingual, good performance and UX, accessible. Of course limited budget. It did not really need dynamic routes or the whole that Plone has to offer. But they did like to use Plone for this. But did not really look like a Volto project.
Bring your own frontend. There is Vite, but we already knew NextJS and had only short time so we went with it.
I felt it was faster for us to really start from scratch with a new layout, for this project. We used framer-motion for animated route changes. And used @plone/client, @plone/providers, @plone/components, Tailwind CSS, TypeScript.
react-aria actively helps you with accessibility, it logs warnings.
After a while they wanted dynamic routes anyway, so being able to create pages in a section of the site and they could get dynamically loaded, next to the static routes. Sure. We used @plone/registry.
What if... we would show the whole site? With the dynamic routes we were almost there anyway, we could show pages with blocks just fine.
Promise: we can run Plone in Next.JS. I am working on a template for that. Features/plan: config registry and add-ons, blocks, slots, fully dynamic routes, dynamic theme. Ideas and feedback are welcome here: https://github.com/plone/volto/pull/6442.