Merge pull request #8730 from sachajudd/docs/page-icons

DOCS Add how to customise page icons in the site tree
This commit is contained in:
Robbie Averill 2019-01-16 10:00:08 +01:00 committed by GitHub
commit 50c074964d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,3 +89,22 @@ __'Scheduled To Publish'__ status. The look of the page node will be changed
from ![Normal Page Node](../../../_images/page_node_normal.png) to ![Scheduled Page Node](../../../_images/page_node_scheduled.png). The getStatusFlags has an `updateStatusFlags()`
extension point, so the flags can be modified through `DataExtension` rather than
inheritance as well. Deleting existing flags works by simply unsetting the array key.
## Customising page icons
The page tree in the CMS is a central element to manage page hierarchies, hence its display of pages can be customised as well. You can specify a custom page icon to make it easier for CMS authors to identify pages of this type, when navigating the tree or adding a new page:
```php
class HomePage extends Page
{
private static $icon_class = 'font-icon-p-home';
}
```
The CMS uses an icon set from [Fontastic](http://fontastic.me/). New icons may be [requested](https://github.com/silverstripe/silverstripe-admin/issues/new) and added to the [core icon set](https://silverstripe.github.io/silverstripe-admin/?selectedKind=Admin%2FIcons&selectedStory=Icon%20reference&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Factions%2Factions-panel). The benefit of having icons added to the core set is that you can use icons more consistently across different modules allowing every module to use a different icon with the same style.
You can also add your own icon by specifying an image path to override the Fontastic icon set:
```php
private static $icon = 'app/images/homepage-icon.svg';
```