Merge branch 'master' into 5.4
[GitHub/WoltLab/woltlab.github.io.git] / docs / package / pip / page.md
1 # Page Package Installation Plugin
2
3 Registers page controllers, making them available for selection and configuration, including but not limited to boxes and menus.
4
5 ## Components
6
7 Each item is described as a `<page>` element with the mandatory attribute `identifier` that should follow the naming pattern `<packageIdentifier>.<PageName>`, e.g. `com.woltlab.wcf.MembersList`.
8
9 ### `<pageType>`
10
11 #### `system`
12
13 The special `system` type is reserved for pages that pull their properties and content from a registered PHP class. Requires the `<controller>` element.
14
15 #### `html`, `text` or `tpl`
16
17 Provide arbitrary content, requires the `<content>` element.
18
19 ### `<controller>`
20
21 Fully qualified class name for the controller, must implement `wcf\page\IPage` or `wcf\form\IForm`.
22
23 ### `<handler>`
24
25 Fully qualified class name that can be optionally set to provide additional methods, such as displaying a badge for unread content and verifying permissions per page object id.
26
27 ### `<name>`
28
29 !!! info "The `language` attribute is required and should specify the [ISO-639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code."
30
31 The internal name displayed in the admin panel only, can be fully customized by the administrator and is immutable. Only one value is accepted and will be picked based on the site's default language, but you can provide localized values by including multiple `<name>` elements.
32
33 ### `<parent>`
34
35 Sets the default parent page using its internal identifier, this setting controls the breadcrumbs and active menu item hierarchy.
36
37 ### `<hasFixedParent>`
38
39 Pages can be assigned any other page as parent page by default, set to `1` to make the parent setting immutable.
40
41 ### `<permissions>`
42
43 !!! warning "The comma represents a logical `or`, the check is successful if at least one permission is set."
44
45 Comma separated list of permission names that will be checked one after another until at least one permission is set.
46
47 ### `<options>`
48
49 !!! warning "The comma represents a logical `or`, the check is successful if at least one option is enabled."
50
51 Comma separated list of options that will be checked one after another until at least one option is set.
52
53 ### `<excludeFromLandingPage>`
54
55 Some pages should not be used as landing page, because they may not always be
56 available and/or accessible to the user. For example, the account management
57 page is available to logged-in users only and any guest attempting to visit that
58 page would be presented with a permission denied message.
59
60 Set this to `1` to prevent this page from becoming a landing page ever.
61
62 ### `<content>`
63
64 !!! info "The `language` attribute is required and should specify the [ISO-639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code."
65
66 #### `<title>`
67
68 The title element is required and controls the page title shown to the end users.
69
70 #### `<content>`
71
72 The content that should be used to populate the page, only used and required if the `pageType` equals `text`, `html` and `tpl`.
73
74
75 ## Example
76
77 ```xml
78 <?xml version="1.0" encoding="UTF-8"?>
79 <data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/2019/page.xsd">
80 <import>
81 <page identifier="com.woltlab.wcf.MembersList">
82 <pageType>system</pageType>
83 <controller>wcf\page\MembersListPage</controller>
84 <name language="de">Mitglieder</name>
85 <name language="en">Members</name>
86 <permissions>user.profile.canViewMembersList</permissions>
87 <options>module_members_list</options>
88
89 <content language="en">
90 <title>Members</title>
91 </content>
92 <content language="de">
93 <title>Mitglieder</title>
94 </content>
95 </page>
96 </import>
97
98 <delete>
99 <page identifier="com.woltlab.wcf.MembersList" />
100 </delete>
101 </data>
102 ```