diff --git a/en/02_Developer_Guides/15_Customising_the_Admin_Interface/03_SingleRecordAdmin.md b/en/02_Developer_Guides/15_Customising_the_Admin_Interface/03_SingleRecordAdmin.md index ad189a31..3c41574f 100644 --- a/en/02_Developer_Guides/15_Customising_the_Admin_Interface/03_SingleRecordAdmin.md +++ b/en/02_Developer_Guides/15_Customising_the_Admin_Interface/03_SingleRecordAdmin.md @@ -27,7 +27,7 @@ class MySettingsAdmin extends SingleRecordAdmin This admin section will fetch a record of the `MySettingsModel` class using the [`get_one()`](api:SilverStripe\ORM\DataObject::get_one()) method. -If you don't want the admin section to fetch your record in this way, you can set the [`restrict_to_single_record`](api:SilverStripe\Admin\SingleRecordAdmin->restrict_to_single_record) configuration property to false. In this case you must provide another way for the admin section to know which record to edit. This could be in the form of a separate action on the controller (e.g. `edit/$ID`), or by calling [`setCurrentPageID()`](api:SilverStripe\Admin\LeftAndMain::setCurrentPageID()) in the [`init()`](api:SilverStripe\Admin\LeftAndMain::init()) method of the controller. +If you don't want the admin section to fetch your record in this way, you can set the [`restrict_to_single_record`](api:SilverStripe\Admin\SingleRecordAdmin->restrict_to_single_record) configuration property to false. In this case you must provide another way for the admin section to know which record to edit. This could be in the form of a separate action on the controller (e.g. `edit/$ID`), or by calling [`setCurrentRecordID()`](api:SilverStripe\Admin\LeftAndMain::setCurrentRecordID()) in the [`init()`](api:SilverStripe\Admin\LeftAndMain::init()) method of the controller. If there's no record to edit, by default it will create one for you. To disable that behaviour, set the [`allow_new_record`](api:SilverStripe\Admin\SingleRecordAdmin->allow_new_record) configuration property to false. diff --git a/en/02_Developer_Guides/15_Customising_the_Admin_Interface/04_CMS_Architecture.md b/en/02_Developer_Guides/15_Customising_the_Admin_Interface/04_CMS_Architecture.md index 030c2418..42982382 100644 --- a/en/02_Developer_Guides/15_Customising_the_Admin_Interface/04_CMS_Architecture.md +++ b/en/02_Developer_Guides/15_Customising_the_Admin_Interface/04_CMS_Architecture.md @@ -449,7 +449,7 @@ class MyAdmin extends LeftAndMain ```ss <%-- MyRecordInfo.ss --%>
- Current Record: $currentPage.Title + Current Record: $currentRecord.Title
``` diff --git a/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Customise_CMS_Tree.md b/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Customise_CMS_Tree.md index 9e83d556..d82d890f 100644 --- a/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Customise_CMS_Tree.md +++ b/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Customise_CMS_Tree.md @@ -13,7 +13,7 @@ by the [jstree](https://jstree.com) library. It is configured through `client/src/legacy/LeftAndMain.Tree.js` in the `silverstripe/admin` module, as well as some HTML5 metadata generated on its container (see the `data-hints` attribute). -The tree is rendered through [LeftAndMain::getSiteTreeFor()](api:SilverStripe\Admin\LeftAndMain::getSiteTreeFor()), +The tree is rendered through [LeftAndMain::getTreeFor()](api:SilverStripe\Admin\LeftAndMain::getTreeFor()), which recursively collects all nodes based on various filtering criteria. The node strictly just has to implement the [Hierarchy](api:SilverStripe\ORM\Hierarchy\Hierarchy) extension, but in the CMS usually is a [SiteTree](api:SilverStripe\CMS\Model\SiteTree) object. @@ -36,7 +36,7 @@ code like this:     - + New Page Deleted @@ -65,7 +65,7 @@ use Page; class HomePage extends Page { - private static $icon_class = 'font-icon-p-home'; + private static $cms_icon_class = 'font-icon-p-home'; // ... } diff --git a/en/08_Changelogs/6.0.0.md b/en/08_Changelogs/6.0.0.md index 88cf1a61..ef83d92a 100644 --- a/en/08_Changelogs/6.0.0.md +++ b/en/08_Changelogs/6.0.0.md @@ -694,7 +694,9 @@ As a result of these changes, the following classes have had their class hierarc |[`SubsiteXHRController`](api:SilverStripe\Subsites\Controller\SubsiteXHRController)|`LeftAndMain`|`AdminController`| |[`CMSExternalLinksController`](api:SilverStripe\ExternalLinks\Controllers\CMSExternalLinksController)|`Controller`|`AdminController`| -The `tree_class` configuration property on `LeftAndMain` and its subclasses has be renamed to [`model_class`](api:SilverStripe\Admin\LeftAndMain->model_class). This is used in methods like [`getRecord()`](api:SilverStripe\Admin\LeftAndMain::getRecord()) to get a record of the correct class. +The `tree_class` configuration property on `LeftAndMain` and its subclasses has be renamed to [`model_class`](api:SilverStripe\Admin\LeftAndMain->model_class), and a new [`getModelClass()`](api:SilverStripe\Admin\LeftAndMain::getModelClass()) method has been implemented to return it. This is used in methods like [`getRecord()`](api:SilverStripe\Admin\LeftAndMain::getRecord()) to get a record of the correct class. + +The `getModelClass()` method is the same method used in `ModelAdmin` to get the class for the currently accessed tab. This parity means you can predictably call `getModelClass()` on any initialised subclass of `LeftAndMain` and get an appropriate base class to work with. #### Effects of this refactor in other classes