Skip to content

Commit 50aaab2

Browse files
committed
MDL-78806 better page title documentation
1 parent c1c874b commit 50aaab2

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

general/development/policies/accessibility.md

+44-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ tags:
66
- Certification
77
---
88

9+
import { ValidExample } from '@site/src/components';
10+
911
Moodle is designed to provide equal functionality and information to all people. This means that there should be no barriers for people regardless of disabilities, assistive technologies that are used, different screen sizes and different input devices (for example mouse, keyboard and touchscreen).
1012

1113
## Accessibility conformance
@@ -121,7 +123,48 @@ See [the ARIA best practice advice on landmarks](https://www.w3.org/TR/wai-aria-
121123

122124
All pages should have a unique title that describes the current page.
123125

124-
See [the WCAG 2.1 success criteria for web page titles](https://www.w3.org/TR/WCAG21/#page-titled) for further information.
126+
Some tips for providing a meaningful page title:
127+
128+
- The page title must be accurate and informative.
129+
- If the page causes a change of context (e.g. a search functionality), it should describe the result or change of context to the user.
130+
- It should be concise.
131+
- If possible, it should uniquely identify the page.
132+
- The most identifying information should come first.
133+
134+
#### Example
135+
136+
Consider that a student in the submission page of an assignment called `Kinetics problem set 1` in the `Physics 101` in the `Moodle University`.
137+
138+
Then a suitable page title for the page would be something like:
139+
140+
<ValidExample>
141+
142+
The most unique identifying information first represented by the activity name and its sub-page, then followed by broader identifiers such as the course name and the site name.
143+
144+
`Kinetics problem set 1: Submit assignment | Physics 101 | Moodle University`
145+
146+
</ValidExample>
147+
148+
<ValidExample>
149+
150+
The most unique identifying information first represented by sub-page's name followed by the activity name that the page belongs to, then followed by broader identifiers such as the course name and the site name.
151+
152+
`Submit assignment | Kinetics problem set 1 | Physics 101 | Moodle University`
153+
154+
</ValidExample>
155+
156+
#### Separating components of a page title
157+
158+
When separating the components of the page tile, please use the `moodle_page:TITLE_SEPARATOR` constant.
159+
160+
#### Site name on the page title
161+
162+
There's no need to add the site's name when setting the page title using `$PAGE->set_title()`. The site name is automatically appended at the end of the page title by default by `$PAGE->set_title()`. The displayed site name on the page title will depend on the admin setting `$CFG->sitenameintitle` whether it's set to show the site's full name or the site's short name.
163+
164+
#### Useful resources
165+
166+
- [Understanding Success Criterion 2.4.2: Page Titled (Level A)](https://www.w3.org/WAI/WCAG21/Understanding/page-titled)
167+
- [Technique G88: Providing descriptive titles for Web pages](https://www.w3.org/WAI/WCAG21/Techniques/general/G88)
125168

126169
### Advanced UX Widgets
127170

0 commit comments

Comments
 (0)