|
@@ -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
|