You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 a getRecordTypes() 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 from CMSMain into it. This class should live in the admin module
getCMSTreeTitle() in HierarchyModelAdmin returns something sensible instead of the site name (this is used as the "root" of the tree)
Make CMSMain subclass HierarchyModelAdmin 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 in HierarchyModelAdmin
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() and invokeWithExtensions() that are being called on records and see if they would be better as extension hooks on the new class instead.
The text was updated successfully, but these errors were encountered:
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 manageSiteTree
records.Related
Notes
Hierarchy
extension.RecordTypes()
method and agetRecordTypes()
method which seem to have different purposes. Maybe rename one of those to something different.Acceptance Criteria
HierarchyModelAdmin
class and move all of the code fromCMSMain
into it. This class should live in the admin modulegetCMSTreeTitle()
inHierarchyModelAdmin
returns something sensible instead of the site name (this is used as the "root" of the tree)CMSMain
subclassHierarchyModelAdmin
and only give it what it needs as a unique admin section (e.g. url segment, section title, model class)CMSMain
and instead make them action methods implemented inHierarchyModelAdmin
CMSMain
templates so that they are named after the new class instead, and move them to the admin moduleHierarchyModelAdmin
is moved to the admin moduleHierarchyModelAdmin
works without needing anything from the cms moduleextends()
andinvokeWithExtensions()
that are being called on records and see if they would be better as extension hooks on the new class instead.The text was updated successfully, but these errors were encountered: