Add link to snippets icon customisation from icons documentation

pull/10478/head
Sage Abdullah 2023-05-01 21:03:42 +07:00 zatwierdzone przez Matt Westcott
rodzic 6ec734f836
commit f2accc89e3
2 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -10,6 +10,7 @@ Elements that use icons are:
- [Client-side components](extending_clientside_components)
- [Rich text editor toolbar buttons](extending_the_draftail_editor)
- [ModelAdmin menu](modeladmin_menu_icon)
- [Snippets](wagtailsnippets_icon)
- [StreamField blocks](custom_streamfield_blocks)
This document describes how to choose, add and customise icons.

Wyświetl plik

@ -69,6 +69,8 @@ class MemberViewSet(SnippetViewSet):
register_snippet(MemberViewSet)
```
(wagtailsnippets_icon)=
## Icon
You can define an {attr}`~wagtail.snippets.views.snippets.SnippetViewSet.icon` attribute on the `SnippetViewSet` to specify the icon that is used across the admin for this snippet type. The `icon` needs to be [registered in the Wagtail icon library](../../advanced_topics/icons). If `icon` is not set, the default `"snippet"` icon is used.