plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
447 stars 607 forks source link

Add possibility to get initialBlocks and initialBlocksLayout from backend #1256

Closed avoinea closed 4 years ago

avoinea commented 4 years ago

Add possibility to get initialBlocks and initialBlocksLayout from backend when adding new content in order to let Site Administrators to dynamically define content default blocks together with DX content definition.

Plone Dexterity Fields dx

Volto Add Form default

avoinea commented 4 years ago

Ok, maybe because we didn't make it clear from the beginning what we are trying to achieve with this, the confusion.

Our main requirement from Volto or a Volto Add-on right now is to be able to define Dexterity Content-Types TTW, as in the real world one page content-type with Title as the default block doesn't fit all cases and customers need content with more metadata, they need to define content initial blocks and maybe some required ones. They need to easily change logo, labels, placeholders, default values, etc (not a developer's job, if you ask me)

For this:

  1. We need Dexterity within Volto > ControlPanel ASAP
  2. We are going to extend this panel with a Volto TTW Dexterity layout editor (which may end-up in the core or as a Volto Add-on, to be discussed).

Excerpt from the Zen of Volto:

That means this someone has to be able to run, test and use Volto (and thus Plone), and ultimately customize a simple project without any problem and without having to touch Plone by any mean or write a single line of Python nor implement a single Plone add-on product.

With this in mind, as Dexterity Content-Types already provide the default values feature, without having to write a single line of Python code within a custom Plone Add-on we think it is the best place were initialBlocks and requiredBlocks should come from. Of course nobody will have to edit this values manually and there will be a nice Volto Control-Panel interface for it.

Also, within current Volto implementation of initialBlocks and requiredBlocks one can NOT provide blocks default values, custom placeholders, etc. Not mentioning the fact that if you add a new Dexterity-Type on backend you need to hire a JavaScript Developer to define the initialBlocks and the requiredBlocks for it. And how is the front-end back-end agnostic if it requires to re-deploy front-end every time you create a new Dexterity Content-Type on backend?

My feeling is that this settings should stay together with the content-type definition.

One last thought:

For the sake of Javascript Developers, let's not cut features and most important let's NOT forget the end-user.

IMHO we should always focus first on the end-User eXperience and the Developer eXperience will follow

avoinea commented 4 years ago

Will close this ticket for now and continue work on https://github.com/plone/volto/issues/1517