pub enum TabBody {
Html(String),
Template {
path: String,
context: Map<String, Value>,
},
Widgets(Vec<Widget>),
Group {
heading: String,
help: String,
layout: PanelLayout,
widgets: Vec<Widget>,
},
Help {
content: String,
},
}Expand description
How a custom tab’s body is supplied. Three shapes:
Html(s)— pre-rendered HTML (backwards-compatible escape hatch; whatTabSpec::new(..., html)produces).Template { path, context }— a Tera template path + a per-tab context map. The page editor renders the template server-side with the standard admin chrome context PLUS the spec’s owncontextmap merged in, and drops the resulting HTML into the tab panel.Widgets(widgets)— declarative form fields. The editor renders eachcrate::Widgetvia the same_widget.htmlmacro the Content tab’s main stack uses, so widget visuals + behavior stay identical wherever they appear.
Variants§
Html(String)
Template
Widgets(Vec<Widget>)
Group
Field group panel. Groups widgets
under a heading; layout picks vertical stack vs side-by-side.
Optional help renders as a hint paragraph between the
heading and the field grid.
Help
Help panel. Static informational block — no form
fields. The body is HTML emitted via | safe after CMS-side
authoring; trust source is the handler author.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TabBody
impl<'de> Deserialize<'de> for TabBody
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TabBody
impl RefUnwindSafe for TabBody
impl Send for TabBody
impl Sync for TabBody
impl Unpin for TabBody
impl UnsafeUnpin for TabBody
impl UnwindSafe for TabBody
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.