Extend Plone With Add-On Packages¶
- There are more than 2,000 add-ons for Plone. We will cover only a handful today.
- Using them saves a lot of time
- The success of a project often depends on finding the right add-on
Su uso, utilidad, calidad y complejidad varia mucho
How to find add-ons¶
https://pypi.python.org/pypi - ¡Use el Formulario de Búsqueda!
https://github.com/collective > 1200 repositorios
https://github.com/plone > 260 repositorios
- http://news.gmane.org/gmane.comp.web.zope.plone.user
google (por ejemplo Plone+Slider)
- Check shortlist Plone Paragon (Launched August 2014)
Pregunta en el canal irc y la lista de correo
Ver también
- A talk on finding and managing add-ons: http://www.youtube.com/watch?v=Sc6NkqaSjqw
Some noteable add-ons¶
Advertencia
Many add-ons will not yet run under Plone 5 and will have to be updated to be compatible. One Example is Products.PloneFormGen: We use our own source-checkout of it from https://github.com/starzel/Products.PloneFormGen that contains small changes that make it compatible with Plone 5.
Other add-ons will be rendered obsolete by Plone 5. There is no more need for collective.quickupload since Plone 5 already has the functionality to upload multiple files at once.
- Products.PloneFormGen
- A form generator.
- collective.plonetruegallery
Galerías de fotos con una gran selección de varios librerías javascript
- collective.cover
Interfaz para crear paginas de inicios complejas
- collective.geo
Paquete flexible de complementos para georeferenciar contenido y mostrar mapas
- collective.mailchimp
Permite a los visitantes suscribirse a noticias Mailchimp
- eea.facetednavigation
Crear la navegación facetada y búsquedas a través de la web.
- webcouturier.dropdownmenu
Convierte la navegación global en menú desplegables
- collective.quickupload
Subida de múltiples archivos usando el concepto drag & drop
- Products.Doormat
Un flexible pie de pagina basado en el patrón de diseño doormat
- collective.behavior.banner
Agrega banners decorativos y pasarelas
- plone.app.multilingual
Permite sitios multilingues mediante la traducción de contenido
- Plomino
Un poderoso y flexible constructor de aplicaciones basado en Web para Plone
Installing Add-ons¶
La instalación es un proceso de dos pasos.
Making the add-on packages available to Zope¶
First, we must make the add-on packages available to Zope. This means that Zope can import the code. Buildout is responsible for this.
Look at the buildout.cfg
file in /vagrant/buildout
.
Nota
If you’re using our Vagrant kit, the Plone configuration is available in a folder that is shared between the host and guest operating systems. Look in your Vagrant install directory for the buildout
folder. You may edit configuration files using your favorite text editor in the host operating system, then switch into your virtual machine to run buildout on the guest operating system.
In the section [instance]
there is a variable called eggs
, which has a list of eggs as a value.
Products.PloneFormGen
collective.plonetruegallery
Generalmente, uno ingresa los paquetes eggs agregando una linea adicional por paquete egg en la configuración, Debes escribir el nombre del paquete egg de forma indentada, así el buildout entiende que la linea actual es parte de la ultima variable y no una nueva variable.
If you add new add-ons here you will have to run buildout and restart the site:
$ cd /vagrant/buildout
$ bin/buildout
$ bin/instance fg
Now the code is available from within Plone.
Installing add-ons in your Plone Site¶
Your Plone site has not yet been told to use the add-on. For this, you have to activate the add-ons in your Plone Site.
Nota
Why the extra step of activating the add-on package? You my have multiple Plone sites in a single Zope installation. It’s common to want to activate some add-ons in one site, others in another.
In your browser, go to Site Setup (shortcut: add /@@overview-controlpanel
to the Plone site URL), and open the Add-ons
Panel. You will see that you can install the add-ons there.
Install PloneFormGen and Plone True Gallery now.
Esto es lo que sucede: el perfil GenericSetup del producto se ha cargado. esto hace cosas como:
- configuring new actions
Registrando nuevos tipos de contenido
- registering css and js files
Creando algunos objetos contenidos / configuración en tu sitio de Plone.
Let’s have a look at what we just installed.
PloneFormGen¶
There are many ways to create forms in Plone:
puro: html y python en una vista
usando framework: z3c.form, formlib, deform
- TTW: Products.PloneFormGen
The basic concept of PloneFormGen is that you build a form by adding a Form Folder, to which you add form fields as content items. Fields are added, deleted, edited and moved just as with any other type of content. Form submissions may be automatically emailed and/or saved for download. There are many PFG add-ons that provide additional field types and actions.
Let’s build a registration form:
- Activate PloneFormGen for this site via the add-on configuration panel in site setup
- Add an object of the new type ‘Form Folder’ in the site root. Call it “Registration”
- Save and view the result, a simple contact form that we may customize
Haga clic en QuickEdit (para la edición rápida)
Remueva el campo “Subject”
- Add fields for food preference and shirt size
Agrega un adaptador DataSave
- Customize the mailer
Nota
Need CAPTCHAs? Add the collective.recaptcha
package to your buildout and PFG will have a CAPTCHA field.
Need encryption? Add GPG encryption to your system, add a GPG configuration for the Plone daemon user that includes a public key for the mail targets, and you’ll be able to encrypt email before sending.
Think PFG is too complicated for your site editors? Administrators (and we’re logged in as an administrator) see lots of more complex options that are invisible to site editors.
By the way, while PloneFormGen is good at what it does, is not a good model for designing your own extensions. It was created before the Zope Component Architecture became widely used. The authors would write it much differently if they were starting from scratch.
Agrega galerías de fotos con collective.plonetruegallery¶
To advertise the conference we want to show some photos showing past conferences and the city where the conference is taking place.
En vez de crear tipos de contenido personalizados para galerías, este se integra con la funcionalidad de Plone para elegir diferentes vistas de tipos de contenidos en carpeta.
https://pypi.python.org/pypi/collective.plonetruegallery
- Activate the add-on
- Enable the behavior
Plone True Gallery
on the typeFolder
: http://localhost:8080/Plone/dexterity-types/Folder/@@behaviors (This step is only required because plonetruegallery does not yet know about the newer plone.app.contenttypes, which we activated to replace Plone’s old content types with newer, Dexterity-style, ones.) Agregue una carpeta /the-event/location
Suba algunas fotos desde http://lorempixel.com/600/400/city/
Habilite la vista
galleryview
collective.plonetruegallery is a better model for how to write a Plone Extension.
Internationalization¶
Plone puede ejecutar el mismo sitio en múltiples lenguajes.
We’re not doing this with the conference site since the lingua franca of the Plone community is English.
Para esto debe usar http://pypi.python.org/pypi/plone.app.multilingual. Ese es el sucesor del Products.LinguaPlone (el cual solo usa Arquetipos).
Nota
Building a multi-lingual site requires activating plone.app.multilingual
, but no add-on is necessary to build a site in a single language other than English. Just select a different site language when creating a Plone site, and all the basic messages will be translated and LTR or RTL needs will be handled.
Resumen¶
Ahora somos capaces de personalizar y ampliar muchas partes de nuestro sitio web. Incluso podemos instalar extensiones que añaden nuevas funcionalidades.
Pero:
¿Podemos enviar Charlas ahora?
- Can we create lists with the most important properties of each talk?
¿Podemos permitir a un jurado votar en las Charlas?
We often have to work with structured data. Up to a degree we can do all this TTW, but at some point we run into barriers. In the next part of the training, we’ll teach you how to break through these barriers.