mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-03 06:38:51 +02:00
Site Reports documentation fix
Fixing typo in Site Reports documentation. Adding more detail to Custom Report example.
This commit is contained in:
parent
45924f1402
commit
89ff059334
@ -19,7 +19,7 @@ By default the CMS ships with several basic reports:
|
|||||||
* Pages with no content
|
* Pages with no content
|
||||||
* Pages edited in the last 2 weeks
|
* Pages edited in the last 2 weeks
|
||||||
|
|
||||||
Modules may come with ther own additional reports.
|
Modules may come with their own additional reports.
|
||||||
|
|
||||||
## Creating Custom Reports
|
## Creating Custom Reports
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ Custom reports can be created quickly and easily. A general knowledge of SilverS
|
|||||||
|
|
||||||
Inside the *mysite/code* folder create a file called *CustomSideReport.php*. Inside this file we can add our site reports.
|
Inside the *mysite/code* folder create a file called *CustomSideReport.php*. Inside this file we can add our site reports.
|
||||||
|
|
||||||
The following example will list every Page on the current site.
|
The following example will create a report to list every page on the current site.
|
||||||
|
|
||||||
###CustomSideReport.php
|
###CustomSideReport.php
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ The following example will list every Page on the current site.
|
|||||||
return 'All Pages';
|
return 'All Pages';
|
||||||
}
|
}
|
||||||
|
|
||||||
// what we want the report to return and what order
|
// what we want the report to return
|
||||||
public function sourceRecords($params = null) {
|
public function sourceRecords($params = null) {
|
||||||
return Page::get()->sort('Title');
|
return Page::get()->sort('Title');
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@ More useful reports can be created by changing the `DataList` returned in the `s
|
|||||||
|
|
||||||
* `CustomSideReport_ReportName` must extend `SS_Report`
|
* `CustomSideReport_ReportName` must extend `SS_Report`
|
||||||
* It is recommended to place all custom reports in the 1 file.
|
* It is recommended to place all custom reports in the 1 file.
|
||||||
** Create a *CustomSideReport.php* file and add classes as you need them inside that for each report
|
* Create a *CustomSideReport.php* file and add classes as you need them inside for each report
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
@ -69,4 +69,4 @@ More useful reports can be created by changing the `DataList` returned in the `s
|
|||||||
* More examples
|
* More examples
|
||||||
|
|
||||||
## API Documentation
|
## API Documentation
|
||||||
`[api:ReportAdmin]`
|
`[api:ReportAdmin]`
|
||||||
|
Loading…
Reference in New Issue
Block a user