A child theme names a parent in its config and uses the parent’s templates for the ones it lacks.
name: Acme child
parent: acme
let child = store::create_child_theme(&db, "acme", "acme-child", "Acme child").await?;
Key Type Default Meaning
parentstring none The theme whose templates fill in for the ones this theme lacks.
Lookup Result
A template by kind and path The theme’s own, else the nearest ancestor’s.
A page’s layout Any layout of the theme or its ancestors.
The settings form The theme’s own, else its parent’s; the values are each theme’s own (see Theme Settings ).
// Through the parent chain: the theme's own row, else the nearest ancestor's.
if let Some((from, template)) = store::resolve_template(&db, "child", Kind::Layout, "default.htm").await? {
println!("{} from {}", template.path, from.code);
}
let chain = store::chain(&db, "child").await?;
store::update_theme_config(&db, "acme-child", "name: Acme child\nparent: base\n").await?;
Call Refused when
create_themeThe parent is missing or leads back to the theme.
update_theme_configThe theme is locked, or the parent is missing or leads back.
delete_themeThe theme is another theme’s parent.
The other calls are under Themes .