Updated FieldPanel to TitleFieldPanel in docs

- Closes #11078
pull/11047/head
Ihedioha Chinedu Innocent 2023-10-19 00:48:09 +01:00 zatwierdzone przez LB (Ben Johnston)
rodzic fb4c4209f5
commit 26a89cf37d
5 zmienionych plików z 10 dodań i 7 usunięć

Wyświetl plik

@ -50,6 +50,7 @@ Changelog
* Use dropdown buttons on listings in dashboard panels (Sage Abdullah)
* Implement breadcrumbs design refinements (Thibaud Colas)
* Support extending Wagtail client-side with Stimulus (LB (Ben) Johnston)
* Update all `FieldPanel('title')` examples to use the recommended `TitleFieldPanel('title')` panel (Chinedu Ihedioha)
* Fix: Ensure that StreamField's `FieldBlock`s correctly set the `required` and `aria-describedby` attributes (Storm Heg)
* Fix: Avoid an error when the moderation panel (admin dashboard) contains both snippets and private pages (Matt Westcott)
* Fix: When deleting collections, ensure the collection name is correctly shown in the success message (LB (Ben) Johnston)

Wyświetl plik

@ -752,6 +752,7 @@
* Hazh. M. Adam
* Chris Lawton
* Meghana Reddy
* Chinedu Ihedioha
## Translators

Wyświetl plik

@ -7,13 +7,13 @@
As standard, Wagtail organises panels for pages into two tabs: 'Content' and 'Promote'. For snippets Wagtail puts all panels into one page. Depending on the requirements of your site, you may wish to customise this for specific page types or snippets - for example, adding an additional tab for sidebar content. This can be done by specifying an `edit_handler` attribute on the page or snippet model. For example:
```python
from wagtail.admin.panels import TabbedInterface, ObjectList
from wagtail.admin.panels import TabbedInterface, TitleFieldPanel, ObjectList
class BlogPage(Page):
# field definitions omitted
content_panels = [
FieldPanel('title', classname="title"),
TitleFieldPanel('title', classname="title"),
FieldPanel('date'),
FieldPanel('body'),
]
@ -32,13 +32,13 @@ class BlogPage(Page):
Permissions can be set using `permission` on the `ObjectList` to restrict entire groups of panels to specific users.
```python
from wagtail.admin.panels import TabbedInterface, ObjectList
from wagtail.admin.panels import TabbedInterface, TitleFieldPanel, ObjectList
class FundingPage(Page):
# field definitions omitted
shared_panels = [
FieldPanel('title', classname="title"),
TitleFieldPanel('title', classname="title"),
FieldPanel('date'),
FieldPanel('body'),
]
@ -179,7 +179,7 @@ or to add custom validation logic for your models:
from django import forms
from django.db import models
import geocoder # not in Wagtail, for example only - https://geocoder.readthedocs.io/
from wagtail.admin.panels import FieldPanel
from wagtail.admin.panels import TitleFieldPanel, FieldPanel
from wagtail.admin.forms import WagtailAdminPageForm
from wagtail.models import Page
@ -219,7 +219,7 @@ class EventPage(Page):
location = models.CharField(max_length=255)
content_panels = [
FieldPanel('title'),
TitleFieldPanel('title'),
FieldPanel('start_date'),
FieldPanel('end_date'),
FieldPanel('address'),

Wyświetl plik

@ -377,7 +377,7 @@ class Book(models.Model):
)
panels = [
FieldPanel('title', widget=title_widget), # then add them as a variable
TitleFieldPanel('title', widget=title_widget), # then add them as a variable
FieldPanel('release_date', widget=date_widget),
FieldPanel('price', widget=forms.NumberInput(attrs={'placeholder': 'Retail price on release'})) # or directly inline
]

Wyświetl plik

@ -121,6 +121,7 @@ Thank you to core contributor (LB (Ben) Johnston) for writing this documentation
* Document the use of the Google developer documentation style guide in documentation (Damilola Oladele)
* Fix Inconsistent URL Format in Getting Started tutorial (Olumide Micheal)
* Add more extensive documentation for the `permission` kwarg support in Panels (LB (Ben) Johnston)
* Update all `FieldPanel('title')` examples to use the recommended `TitleFieldPanel('title')` panel (Chinedu Ihedioha)
### Maintenance