Hi there
Wondered if anyone else could provide some input on this issue I have for my Project. Still newish to this too.
I need to create something on a Volto frontend for my Projects LIMS user manual which they had built with a portlet on their old Plone 4 backend site.
But Volto currently does not have portlet functionality like the backend so we thought of creating a custom volto component to fetch data from the backends API?
Would appreciate feedback on the viability of that idea or any alternatives others have maybe used?
Thanks!
The functionality similar to portlets is not something yet supported by volto.
It's been discussed by nothing has been decided. There are reasons not to have portlets as a concept in Volto and replace it with something else.
You can of course write an api endpoint to expose portlets however you would be left without a UI for users to manage portlets in volto. The editors would have to use classic to manage portlets.
Our company has created our own solution which isn't portlets - GitHub - pretagov/volto-slots-editor but we aren't yet sure this is the right way to go.
We are also looking at if we can have mergeable layouts similar to what mosaic had. This would allow some blocks to be edited in the control panel and other blocks to be edited on the content itself and there would be ways the editor could control which layout they use for given page. For example a page setting might change the layout to allow a sidebar which can be edited at the same time as the rest of the content, but that sidebar could contain blocks that can't edited.
Brainstorming (I am not using Volto, but I have done 'similar things i Wordpress':
Could the sidebar be a block which contain other blocks (making blocks that cant be edtited should be easy, or the edit 'view' could just be 'you cant edit this block here'). Then you put the block on 'all pages', but does not render it unless it contains something?
There is a CSS rule ( :has ) which could be used for styling it (maybe)
There is support in volto now for non editable blocks.
There is sort of support for containers, for example the columns block. But it has a very customised UI to make it work. There isn't generic support for containers inside containers.
That is missing is how layouts work. If you define a layout for a content type you can put in a columns block and specify that it can't be edited and that will work. However if you change the settings of that column in the control panel then it won't change for all those existing items that have been created. That is because layouts is really a prototype that gets copied on item creation.
What is needed is a dynamic merge that allows for blocks from the layout and the item to be combined at render time. I think that is doable.
The other thing that is missing is that you can only have one layout per content type. It would be nice to have some rule based system so the layout used is also dynamically picked at render time. For example a setting in the page to pick a "page variation", similar to how you can turn on next/prev navigation.
Then you could have a page with a sidebar or one without for example.
Or maybe the rule is that at level 2 or below on a site the layout now includes a side navigation block.
I think if you took the layouts out of content types and just had a generic rule system that determined when a layout was used then you would have a lot of flexibility and still keep a default rule being content_type="...".
If you then combined this with a slot system where you theme defined additional parts of the page as containers then your layout could let you set if those are editable or not based on the rules maybe.
Not sure if 'it is related', but Wordpress has two ways of rendering content, except from the 'default', there is also a 'ServerSideRendering' which is 'basically oldstyle php'. Would it be possible to do 'something similar in Plone ?
(note, as mentioned before: I have not 'moved to Volto, I am wating for more add-ons etc 'to work' and a a way to run several small sites on same server without using containers)