Add docs for FieldPanel's icon parameter

pull/10345/head
Sage Abdullah 2023-04-05 16:16:43 +01:00 zatwierdzone przez Thibaud Colas
rodzic ff1c9c8aa0
commit eb49f3cdf0
2 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -75,6 +75,7 @@ Place your app before any Wagtail apps in `INSTALLED_APPS`.
Wagtail icons live in `wagtail/admin/templates/wagtailadmin/icons/`.
Place your own SVG files in `<your_app>/templates/wagtailadmin/icons/`.
(available_icons)=
## Available icons
Enable the [styleguide](styleguide) to view the available icons and their names for any given project.

Wyświetl plik

@ -19,7 +19,7 @@ Here are some Wagtail-specific types that you might include as fields in your mo
### FieldPanel
```{eval-rst}
.. class:: FieldPanel(field_name, classname=None, widget=None, heading='', disable_comments=False, permission=None)
.. class:: FieldPanel(field_name, classname=None, widget=None, icon=None, heading='', disable_comments=False, permission=None)
This is the panel used for basic Django field types.
@ -27,7 +27,7 @@ Here are some Wagtail-specific types that you might include as fields in your mo
This is the name of the class property used in your model definition.
.. attribute:: FieldPanel.classname
.. attribute:: FieldPanel.classname (optional)
This is a string of optional CSS classes given to the panel which are used in formatting and scripted interactivity.
@ -37,6 +37,10 @@ Here are some Wagtail-specific types that you might include as fields in your mo
This parameter allows you to specify a :doc:`Django form widget <django:ref/forms/widgets>` to use instead of the default widget for this field type.
.. attribute:: FieldPanel.icon (optional)
This allows you to override the icon for the panel. If unset, Wagtail uses a set of default icons for common model field types. For a list of icons available out of the box, see :ref:`available_icons`. Project-specific icons are also displayed in the :ref:`styleguide`.
.. attribute:: FieldPanel.heading (optional)
This allows you to override the heading for the panel, which will otherwise be set automatically using the form field's label (taken in turn from a model field's ``verbose_name``).