Shared blocks on every News Item: has anyone solved this?

Every news item on our sites ends with the same set of blocks: a latest-news carousel and often a form or call to action. When we want to change one of them, we have to open every old news item and change it there. Ain't nobody got time for that!

What I've found so far:

  • Content-type layouts only set the defaults for new items. Existing items keep their own copies.
  • Volto slots (aboveContent / belowContent with ContentTypeCondition) do the right thing on the page, but they're set up in code. Every change means a release.
  • Classic portlets did exactly this, but Volto doesn't support them.

What I'm thinking of building: a control panel. An admin picks a content type, builds the block there with its normal editor, chooses above or below the content, and manages exclusions (single items or whole folders) in the same place. The page renders it through Volto's existing slots. (I have quite literally just described the old Portlets interface)

Before I move on this:

  • Has someone already done this, or something close?
  • Is there a reason it's a bad idea that I'm not seeing?
  • Has anyone got a form block (volto-form-block) working outside the page's own blocks? It submits to /@submit-form, which looks for the block on that page.

If you've hit the same problem, I'd love to hear how you handled it, and I'd be happy to collaborate on it.

Thanks Hannah, that's really helpful, and it's good to hear the idea isn't crazy.

That's pretty much where we landed. One tweak: @registry needs Manager rights, so instead of reading the registry from the frontend we're thinking of a restapi expander on content. The backend works out which slots apply (type plus exclusions by UID, including whole folders) and sends them with the page. That way visitors never see the exclusion list, and there's no extra request.

The form is a must for us. It's a newsletter signup, wired to the mailing list through formsupport's submit event. Your endpoint idea fits, but since the block lives in the registry and not on a page, we'd post a slot id instead of a container UID. The endpoint checks the slot applies to that item, then runs formsupport's normal submit with the block lookup pointed at the slot, so the mailing-list hook fires as usual. Have you come across anything else in formsupport that assumes the block is on the page?

I'll post back here once there's something to try.