plone / plone.volto

Plone add-on to configure Plone with Volto, the new default frontend for Plone 6.
https://6.demo.plone.org/
3 stars 3 forks source link

Add block types index to zcatalog #121

Closed margaridasp closed 10 months ago

margaridasp commented 1 year ago

Fixes https://github.com/plone/volto/issues/4778

Needs a bit more work on nested blocks.

Note: depends on https://github.com/plone/plone.restapi/pull/1648

mister-roboto commented 1 year ago

@margaridasp thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

davisagli commented 1 year ago

@margaridasp I started working on an easier way to find all nested blocks: https://github.com/plone/plone.restapi/pull/1648

margaridasp commented 11 months ago

@margaridasp I started working on an easier way to find all nested blocks: plone/plone.restapi#1648

Hey @davisagli that's great!! :tada: I've been wanting to have a look at your PR, I will do so when I can!

davisagli commented 11 months ago

@jenkins-plone-org please run jobs

davisagli commented 11 months ago

@jenkins-plone-org please run jobs

sneridagh commented 6 months ago

@davisagli @margaridasp I've been taking a look at this one, and I saw that it's not documented at all. (Could be that I've missed it). If not, it would be great to have some documentation about it, so we can create a PLIP for the block audit control panel.

Also, another question, why did we not include a metadata field for this? We cannot ask a content brain for his blocks without getting the content and iterate over them.

wesleybl commented 6 months ago

One thing that I find strange is that types of content that do not have blocks, such as images, are indexed by the parent content. If an image is inside a page that has a slate block, the slate key lists that image.

davisagli commented 5 months ago

it would be great to have some documentation about it

@sneridagh Sorry, good point. I'll work on this.

why did we not include a metadata field for this? We cannot ask a content brain for his blocks without getting the content and iterate over them.

I didn't anticipate a need for this. I don't think it would be needed unless we want to show what types of blocks an item uses in a listing, which seems unlikely.

One thing that I find strange is that types of content that do not have blocks, such as images, are indexed by the parent content. If an image is inside a page that has a slate block, the slate key lists that image.

@wesleybl This is a bug! The indexer needs to do aq_base(obj).blocks instead of just obj.blocks. I was mistakenly thinking that the indexer decorator takes care of wrapping the context in an explicit acquisition wrapper.