Skip to main content

Module page_type

Module page_type 

Source
Expand description

Page types: the PageTypeHandler trait every page kind implements, its inventory registry (find_handler, registered_handlers), and the editor-form types the handler returns (ExtensionField, TabSpec, InlinePanelSpec, DisplayField).

#[derive(PageType)] generates the handler and forwards the author-overridable hooks to PageTypeOverrides.

Structs§

ChildrenPage
One window of a page’s published_children.
DisplayField
One computed display chip rendered in the page-edit form’s “At a glance” panel. See PageTypeHandler::display_fields.
ExtensionField
Form-field metadata returned by PageTypeHandler::extension_fields. The admin’s page-edit form renders one input per entry under the “Content” section so authors can write into the type’s extension table without leaving the editor.
InlinePanelSpec
One inline panel declaration — a 1-N relation between the page and a child table the handler maintains. See PageTypeHandler::inline_panels. The admin editor renders each row as a card of widgets (any crate::Widget kind: selects, switches, the media chooser…) with add, remove and move up / down, in the Content tab or in a tab of its own (Self::in_tab).
InlineRowSummary
One row of a per-row inline panel, as its card header shows it.
PageTypeHandlerRegistration
Inventory entry — drop one of these next to each PageTypeHandler impl (or use crate::register_page_type!) and it becomes discoverable at runtime via registered_handlers.
TabSpec
One handler-contributed tab appended to the page-editor’s built-in tab strip (Content / Promote / Theme / Revisions). See PageTypeHandler::extra_tabs.

Enums§

ChildOrder
How published_children_page orders a page’s children.
ExtensionFieldKind
Which admin widget to draw for an ExtensionField.
InlineRowSaved
What PageTypeHandler::save_inline_row did.
PanelLayout
Layout direction for TabBody::Group.
TabBody
How a custom tab’s body is supplied. Three shapes:

Traits§

PageTypeHandler
A page kind registered by user code (e.g. BlogPostPage, LandingPage).
PageTypeOverrides
Optional-override trait for declarative page types defined via #[derive(PageType)]. The derive emits the full PageTypeHandler impl and delegates every author-overridable method (allowed_parent_types, allowed_child_types, is_creatable, feed_kind, display_fields, extra_tabs) to <Self as PageTypeOverrides>::*. Every method has a sensible default; an author that doesn’t need overrides writes a one-line impl PageTypeOverrides for MyPage {}.

Functions§

all_children
Every immediate child, ordered sort_order, id — drafts, scheduled and expired pages included. For admin-side listings; never the public default.
any_type_view_restriction
true when any registered handler declares a per-type PageTypeHandler::view_restriction (#members). Cached — the handler registry is static for the life of the process — so the hot menu-filtering path can skip the per-type restriction lookup entirely on binaries that gate nothing by type.
default_children
The framework-default children listing, backing PageTypeHandler::children_query’s default: the same live children as published_children.
find_handler
Look up a registered handler by type_name.
published_children
Immediate children a visitor can open right now, ordered sort_order, id: published and not expired, or scheduled and past go-live — the same rule the resolver serves by (crate::resolver::visible_now). Error pages are left out: they are served for a status code, not listed as content (as in auto_menu). The building block for an index/listing page’s PageTypeHandler::children_query override.
published_children_page
One window of the live children of page: the same rows as published_children, ordered by order, counted and paged in SQL.
registered_handlers
All PageTypeHandlers registered in the current binary.