catalyst / moodle-block_multiblock

Moodle plugin which allows you to embed multiple blocks within a single block region using different formats including tabs and accordions
GNU General Public License v3.0
12 stars 11 forks source link

Refactor the different layouts to be subplugins #29

Closed peterspicer-catalyst closed 4 years ago

peterspicer-catalyst commented 4 years ago

Refactoring the different layouts to be subplugins would allow for new possibilities that the current rendering can't do because it has no ability to do them - for example, a 2/1 alternating with a 1/2 layout isn't feasible in the current setup because it has no way to safely identify which blocks should be what and where.

If each multiblocklayout was its own plugin, it'd be able to have its own renderer (or inherit a parent) that would handle the render pipeline and splice in any variables needed, like sequence numbers for the above example or otherwise alternate the Bootstrap class names.

Arantor commented 4 years ago

Also means that it becomes easier to write tests specific to each layout type that are meaningful.

Arantor commented 4 years ago

Or it would if it were possible - https://tracker.moodle.org/browse/MDL-67595 - but in the meantime it's possible to do something around refactoring into classes and using namespaces to do stuff.

Arantor commented 4 years ago

Closing for now - will revisit in future.