Skip to content

Commit a9e542f

Browse files
committed
Document that content_type template wires parent allowed_content_types itself
Containment is handled by the template's post-copy hook; the agent should pass global_allow=false + parent_content_type and not hand-edit parent FTI types/*.xml.
1 parent b658560 commit a9e542f

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

plonecli/skills/plonecli/reference/add.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Always confirm what is actually available here with `plonecli -l` (run inside th
4444

4545
| Subtemplate | Adds | Typical follow-up |
4646
|---|---|---|
47-
| `content_type` | A Dexterity content type (schema, FTI, registration). | Add schema fields ([fields.md](fields.md)); restart/reinstall so the new type is registered; add tests. |
47+
| `content_type` | A Dexterity content type (schema, FTI, registration). For containment, also wires the new type into the parent's `allowed_content_types`. | Add schema fields ([fields.md](fields.md)); restart/reinstall so the new type is registered; add tests. |
4848
| `behavior` | A behavior (reusable schema/marker applied to content types). | Add schema fields ([fields.md](fields.md)); wire the behavior onto a content type; add tests. |
4949
| `restapi_service` | A `plone.restapi` service (endpoint, adapter, registration). | Add tests exercising the endpoint. |
5050

plonecli/skills/plonecli/reference/templates.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ Example: `plonecli add behavior --defaults -d behavior_name="IFeatured"`
118118
Hidden/computed: `content_type_class`, `content_type_module`, `content_type_interface`,
119119
`content_type_portal_type`, `parent_content_type_resolved`.
120120

121+
**Containment is fully wired by the template — do not edit the parent FTI yourself.** When you
122+
pass `global_allow=false` + `parent_content_type`, the post-copy hook adds the new type to that
123+
parent's `allowed_content_types`: it edits the parent FTI's `types/*.xml` if the parent lives in
124+
this package, or creates a minimal `purge="False"` FTI override (e.g. for stock Plone `Folder`) that
125+
only appends the new type. So just answer `parent_content_type` (and `parent_content_type_manual`
126+
for a type not in the choices) — never hand-edit allowed types in any `types/*.xml` before or after.
127+
121128
Example (containment): `plonecli add content_type --defaults -d content_type_name="Talk" -d global_allow=false -d parent_content_type="Folder"`
122129

123130
### `restapi_service``plone.restapi` endpoint

0 commit comments

Comments
 (0)