Jai
Jai

Reputation: 399

Allowed parents and Allowed children property in CQ template

What is the purpose of allowed parents and allowed children property while creating a cq template? The description in documentation simply says "Path of a component that is allowed to be a parent of this component"/"Path of a component that is allowed to be a child of this component". What is the importance of these properties?

Upvotes: 5

Views: 8785

Answers (1)

Oleksandr Tarasenko
Oleksandr Tarasenko

Reputation: 1454

These properties allows you to set some contract of structure of pages in you project. For example: you have 3 templates (and corresponding pages with this templates):

  • template-1: allowedChildren="[template-2]"
  • template-2: allowedChildren="[template-3]"
  • template-3: allowedChildren="[]"

Then in siteadmin, you will be able to create:

  • under page with template "template-1" only pages with template "template-2",
  • under page with template "template-2" only pages with template "template-3",
  • under page with template "template-3" you will not be able to create any page.

Upvotes: 6

Related Questions