Open
Description
SiteTree
is not the only model with hierarchical data. It would be good to be able to manage other hierarchical data in the same way we currently manage SiteTree
records.
Related
Notes
- The exact name of the class isn't important - if you think of a better name, feel free. Though note this class does go hand-in-hand with the
Hierarchy
extension. - There's a
RecordTypes()
method and agetRecordTypes()
method which seem to have different purposes. Maybe rename one of those to something different.
Acceptance Criteria
- Make a new abstract
HierarchyModelAdmin
class and move all of the code fromCMSMain
into it. This class should live in the admin module getCMSTreeTitle()
inHierarchyModelAdmin
returns something sensible instead of the site name (this is used as the "root" of the tree)- Make
CMSMain
subclassHierarchyModelAdmin
and only give it what it needs as a unique admin section (e.g. url segment, section title, model class) - Delete the subclasses of
CMSMain
and instead make them action methods implemented inHierarchyModelAdmin
- Make sure the correct (renamed) templates are used for these actions
- Rename all of the
CMSMain
templates so that they are named after the new class instead, and move them to the admin module - Any JS and CSS which applied to
HierarchyModelAdmin
is moved to the admin module - The
HierarchyModelAdmin
works without needing anything from the cms module - Double check the
extends()
andinvokeWithExtensions()
that are being called on records and see if they would be better as extension hooks on the new class instead.
Activity