Closed peterspicer-catalyst closed 4 years ago
Also means that it becomes easier to write tests specific to each layout type that are meaningful.
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.
Closing for now - will revisit in future.
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.