2
0
Karl Hobley 2 жил өмнө
parent
commit
996866fc06

+ 1 - 0
CHANGELOG.txt

@@ -34,6 +34,7 @@ Changelog
  * Introduce a `wagtail.admin.viewsets.chooser.ChooserViewSet` module to serve as a common base implementation for chooser modals (Matt Westcott)
  * Add documentation for `wagtail.admin.viewsets.model.ModelViewSet` (Matt Westcott)
  * Enhance new Breadcrumbs so they can be added to any header or container element and adopt on the page explorer (listing) view (Paarth Agarwal)
+ * Added multi-site support to the API (Sævar Öfjörð Magnússon)
  * Fix: Typo in `ResumeWorkflowActionFormatter` message (Stefan Hammer)
  * Fix: Throw a meaningful error when saving an image to an unrecognised image format (Christian Franke)
  * Fix: Remove extra padding for headers with breadcrumbs on mobile viewport (Steven Steinwand)

+ 26 - 22
docs/advanced_topics/api/v2/usage.md

@@ -332,14 +332,18 @@ the current page back to the site's root page.
 The `?descendant_of` filter takes the id of a page and filter the list
 to only include descendants of that page (children, grandchildren etc.).
 
+(api_filtering_pages_by_site)=
 
 ### Filtering pages by site
 
+```{versionadded} 4.0
+```
+
 By default, the API will look for the site based on the hostname of the request.
 In some cases, you might want to query pages belonging to a different site.
-The `?site=` filter is used to filter the listing to only include pages that 
-belong to a specific site. The filter requires the configured hostname of the 
-site. If you have multiple sites using the same hostname but a different port 
+The `?site=` filter is used to filter the listing to only include pages that
+belong to a specific site. The filter requires the configured hostname of the
+site. If you have multiple sites using the same hostname but a different port
 number, it's possible to filter by port number using the format `hostname:port`.
 For example:
 
@@ -539,7 +543,7 @@ For example: `/api/v2/pages/find/?html_path=/` always redirects to the homepage
 
 These fields are returned by every endpoint.
 
-**`id` (number)**  
+**`id` (number)**
 The unique ID of the object
 
 ```{note}
@@ -548,55 +552,55 @@ so you must combine this with the ``type`` field in order to get a
 unique identifier for an object.
 ```
 
-**`type` (string)**  
+**`type` (string)**
 The type of the object in `app_label.ModelName` format
 
-**`detail_url` (string)**  
+**`detail_url` (string)**
 The URL of the detail view for the object
 
 ### Pages
 
-**`title` (string)**  
-**`meta.slug` (string)**  
-**`meta.show_in_menus` (boolean)**  
-**`meta.seo_title` (string)**  
-**`meta.search_description` (string)**  
-**`meta.first_published_at` (date/time)**  
+**`title` (string)**
+**`meta.slug` (string)**
+**`meta.show_in_menus` (boolean)**
+**`meta.seo_title` (string)**
+**`meta.search_description` (string)**
+**`meta.first_published_at` (date/time)**
 These values are taken from their corresponding fields on the page
 
-**`meta.html_url` (string)**  
+**`meta.html_url` (string)**
 If the site has an HTML frontend that's generated by Wagtail, this
 field will be set to the URL of this page
 
-**`meta.parent`**  
+**`meta.parent`**
 Nests some information about the parent page (only available on detail
 views)
 
-**`meta.alias_of` (dictionary)**  
+**`meta.alias_of` (dictionary)**
 If the page marked as an alias return original page id and full url
 
 ### Images
 
-**`title` (string)**  
+**`title` (string)**
 The value of the image's title field. Within Wagtail, this is used in
 the image's `alt` HTML attribute.
 
-**`width` (number)**  
-**`height` (number)**  
+**`width` (number)**
+**`height` (number)**
 The size of the original image file
 
-**`meta.tags` (list of strings)**  
+**`meta.tags` (list of strings)**
 A list of tags associated with the image
 
 ### Documents
 
-**`title` (string)**  
+**`title` (string)**
 The value of the document's title field
 
-**`meta.tags` (list of strings)**  
+**`meta.tags` (list of strings)**
 A list of tags associated with the document
 
-**`meta.download_url` (string)**  
+**`meta.download_url` (string)**
 A URL to the document file
 
 ## Changes since v1

+ 1 - 0
docs/releases/4.0.md

@@ -43,6 +43,7 @@ When using a queryset to render a list of images, you can now use the ``prefetch
  * Introduce a `wagtail.admin.viewsets.chooser.ChooserViewSet` module to serve as a common base implementation for chooser modals (Matt Westcott)
  * Add documentation for `wagtail.admin.viewsets.model.ModelViewSet` (Matt Westcott)
  * Enhance new Breadcrumbs so they can be added to any header or container element and adopt on the page explorer (listing) view (Paarth Agarwal)
+ * Added [multi-site support](api_filtering_pages_by_site) to the API (Sævar Öfjörð Magnússon)
 
 ### Bug fixes