silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
722 stars 821 forks source link

SPIKE Investigate extending SiteTree/ContentController instead of Page/PageController #10537

Closed emteknetnz closed 1 year ago

emteknetnz commented 1 year ago

Follow on issue from https://github.com/silverstripe/silverstripe-framework/issues/10466

Currently we have a bad piece of architecture where core and non-core module classes extend the Page and PageController classes which reside in project code.

Investigate the feasibility of changing:

The following core and non-core controllers were identified:

Core:

Non-core:

Acceptance criteria

michalkleiner commented 1 year ago

As Guy hinted at in #10466, I would either leave the status quo as it's what developers are used to working with, or remove the concept of Page and PageController altogether, leaving SiteTree and ContentController as the building blocks and leaving it up to devs to create their own project-level reusable BasePage and BasePageController (like CWP had) or use extensions to apply custom behaviour to core and non-core page classes.

In short, I'd be against the hybrid where the project code has Page and PageController coming from the recipe but the core classes not extending that.

maxime-rainville commented 1 year ago

Yeah. I don't think we're going to do this in the short term. I remember us talking about how we could allow people to put Page/PageController into your project namespace at some stage but it was put into the too hard basket.

We can probably revisit this in a more holistic way once we start thinking about CMS 6

maxime-rainville commented 1 year ago

That's where we thought about this https://github.com/silverstripe/silverstripe-framework/issues/5844