Wiki source code of Page Templates
Last modified by Eleni Cojocariu on 2026/11/24 18:48
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{version since="18.10.0RC1"}} | ||
| 2 | The [[Page Templates API>>doc:extensions:Extension.XWiki Platform - Page Templates - API.WebHome]] reads [[template providers>>doc:documentation.xs.user.page.create.create-page-template.page-templates.WebHome]]: Pages holding an ##XWiki.TemplateProviderClass## Object, which administrators create as described in [[Page Templates>>doc:documentation.xs.admin.page-templates.WebHome]] to offer a template when creating a Page, and to say where and how the new Page is created. | ||
| 3 | |||
| 4 | Code reads template providers through [[this API>>doc:documentation.xs.dev.page-templates.api.WebHome]] instead of the Object's properties. It turns the Object into a typed ##TemplateProvider##, and also reads the properties of template providers written for older versions: | ||
| 5 | |||
| 6 | * a template provider with no ##terminal## value creates terminal Pages unless its legacy ##type## property is ##space##; | ||
| 7 | * an empty visibility or creation restriction is read from the legacy ##spaces## property instead, as for the [[template provider fields>>doc:documentation.xs.admin.page-templates.template-provider-fields.WebHome]]. | ||
| 8 | |||
| 9 | The API only reads template providers: it creates no Page. [[Live Data>>doc:documentation.xs.user.livedata.display-data.sources.WebHome||anchor="HRowNamingStrategies"]] uses it to create new entries from a template. | ||
| 10 | {{/version}} |