Skip to content

Commit dd535b8

Browse files
committed
DOC Document changes to CMSMain and LeftAndMain
1 parent 34757b7 commit dd535b8

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

en/02_Developer_Guides/15_Customising_the_Admin_Interface/04_CMS_Architecture.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ class MyAdmin extends LeftAndMain
450450
```ss
451451
<%-- MyRecordInfo.ss --%>
452452
<div data-pjax-fragment="MyRecordInfo">
453-
Current Record: $currentPage.Title
453+
Current Record: $currentRecord.Title
454454
</div>
455455
```
456456

en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Customise_CMS_Tree.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ by the [jstree](https://jstree.com) library. It is configured through
1313
`client/src/legacy/LeftAndMain.Tree.js` in the `silverstripe/admin` module, as well as some
1414
HTML5 metadata generated on its container (see the `data-hints` attribute).
1515

16-
The tree is rendered through [LeftAndMain::getSiteTreeFor()](api:SilverStripe\Admin\LeftAndMain::getSiteTreeFor()),
16+
The tree is rendered through [LeftAndMain::getTreeFor()](api:SilverStripe\Admin\LeftAndMain::getTreeFor()),
1717
which recursively collects all nodes based on various filtering criteria.
1818
The node strictly just has to implement the [Hierarchy](api:SilverStripe\ORM\Hierarchy\Hierarchy) extension,
1919
but in the CMS usually is a [SiteTree](api:SilverStripe\CMS\Model\SiteTree) object.
@@ -36,7 +36,7 @@ code like this:
3636
<ins class="jstree-checkbox">&nbsp;</ins>
3737
<ins class="jstree-icon">&nbsp;</ins>
3838
<span class="text">
39-
<span class="jstree-pageicon"></span>
39+
<span class="jstree-recordicon"></span>
4040
<span class="item" title="Deleted">New Page</span>
4141
<span class="badge deletedonlive">Deleted</span>
4242
</span>
@@ -65,7 +65,7 @@ use Page;
6565

6666
class HomePage extends Page
6767
{
68-
private static $icon_class = 'font-icon-p-home';
68+
private static $cms_icon_class = 'font-icon-p-home';
6969

7070
// ...
7171
}

en/08_Changelogs/6.0.0.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,9 @@ As a result of these changes, the following classes have had their class hierarc
629629
|[`SubsiteXHRController`](api:SilverStripe\Subsites\Controller\SubsiteXHRController)|`LeftAndMain`|`AdminController`|
630630
|[`CMSExternalLinksController`](api:SilverStripe\ExternalLinks\Controllers\CMSExternalLinksController)|`Controller`|`AdminController`|
631631

632-
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.
632+
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.
633+
634+
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.
633635

634636
#### Effects of this refactor in other classes
635637

0 commit comments

Comments
 (0)