Format reference
Placeholders
The words Kapi fills in when a person opens a course: the company's name, its contacts and the learner's first name.
Words can hold placeholders in braces. Kapi fills them in from the company's settings when a person opens the course. Declare each one in context in kapi-works.json: "required" when the course needs it, "optional" when it works without it.
| Placeholder | Declare in context | What Kapi fills in |
|---|---|---|
{company.name} | company.name | The company's name, for {company.name}. |
{learner.firstName} | learner.firstName | The person's first name, for {learner.firstName}, where the company switches it on. |
{contacts.<key>.name}, {contacts.<key>.email}, {contacts.<key>.phone}, {contacts.<key>.url} | contacts.<key> | A contact the company fills in, such as contacts.it-help, for {contacts.it-help.name}, .email, .phone and .url. |
A contact block shows a whole contact, by its key. Where the company hasn't filled in an optional contact, the page shows common.contact-missing.<key> from the words file instead.
Context without a placeholder
Kapi gives a course these too. Words can't name them.
| Key | What it is |
|---|---|
door | Which door the person learns through: employee, partner or customer. |
role | The person's role, one of roles. |
What Kapi checks
| Check | Severity | What Kapi says |
|---|---|---|
placeholder_unknown | Error | … isn't a placeholder Kapi fills. Use {company.name}, {contacts.<key>.name}, .email, .phone, .url or {learner.firstName}. |
placeholder_undeclared | Error | These words use a placeholder, but kapi-works.json doesn't declare … in context. |
placeholder_in_link | Error | A link address can't hold a placeholder. Kapi checks every address before a learner opens it. |
first_name_twin_missing | Error | These words use {learner.firstName}, so they need a twin, …, for people whose first name isn't given. |
contact_missing_word | Error | This contact is optional, so write … for companies that haven't filled it in. |
context_not_allowed | Error | … can't be required for customers. Kapi never gives it in a customer door. |