plone.restapi
plone.restapi copied to clipboard
Layout based serialization, include default_page in serialization
This PR makes it possible to use a different content serializer, based on the layout property of context (the default view, selected from the Display menu). I don't have a use case right now, but I think it would make sense to have it.
For example: suppose I have a component that serves as a layout view. Something like, I don't know, "database search results". This is not a block-based page, it's a traditional content type. If I'm able to switch between layout views for it, each of those Volto layout components could then potentially need different serialization data from the backend.
There's another feature in this PR: It includes, in the serialization of folders, a new property called "default_page" which serializes the linked default_page content, where it exists.
In theory, with the exception of the Plone site (right now in Plone 5.2, where the Plone site is not a content item), there's no other place where "default pages" make sense. Volto block-based pages have a lot freedom in them on how they're composed.
Note: I'm asking for feedback. The PR is not finished, there's tests missing, etc.
@tiberiuichim thanks for creating this Pull Request and help improve Plone!
To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass.
Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:
@jenkins-plone-org please run jobs
With this simple comment all the jobs will be started automatically.
Happy hacking!
@jenkins-plone-org please run jobs
@tisto Is the idea good for you? If so, I can make the requested changes and implement the tests.