Skip to content

Title Pattern

Definition

The title pattern is a user-configurable template that is used to build the title for an Entity. title patterns are defined for all Entities in a Bundle and can consist of multiple constituents that can be either:

  • Paths that appear in the Bundle or
  • configurable static text (usually braces or separators)

The title pattern can be built by navigating to Manage → Structure → WissKI Entities & Bundles, then selecting the desired Bundle and opening the Title Pattern tab.

Removing all rows and saving is a valid configuration: the bundle then uses the setting for an empty title. When a row cannot be saved, the error message names it by the number shown in the first column and gives the reason, for example a condition that still references a removed row.

Options of a value row

The wrench button in the Options column opens the options of a Path row in a dialog; its tooltip lists the options. The icon in the Dependencies column opens the condition groups of a row; it is inverted while conditions are set, and its tooltip shows them, such as 1 AND !2.

  • optional: if not set, an entity without a value here gets no title from the pattern but the setting for an empty title.
  • Show #: the most values the title shows (1, 2, 3 or all).
  • Delimiter: separates those values.
  • Allowed HTML tags (only for a formatted text field; other fields keep angle brackets such as Frankfurt <Main>): tag names separated by spaces, by default a strong em b i code sub sup. A formatted text keeps only these tags; every other tag is removed and its text stays, and block tags such as p or div become a space, so a title shows My title instead of <p>My title</p>. An empty list removes every tag; a value without tags stays as written. A value left without tags has its entities decoded (&amp; becomes &), except &lt; and &gt;, so typed text such as &lt;b&gt; never becomes a tag. Kept tags appear as HTML only where the title is output as markup, such as the WissKI title field in Views; page headings and links escape the title, so they show a kept tag as text. Remove strong or em from the list if the title shows there.
  • Show EDTF as readable text: every path row, while WissKI Date Field Extractor is enabled. The row's text can hold EDTF, including the title of a referenced entity; text that is not EDTF stays as written. Off by default. See Dates in labels.

Multilingual titles

A title is built for every enabled language. Static text blocks may store a different string per language: the Content column holds the default language, and on multilingual sites a Translate icon opens a dialog for the others (filled translations invert the icon; the tooltip lists their language codes); a language without its own string uses the default label. A path value stays in the language it was stored in. A value with no language tag belongs to the Bundle's default language, set under Configuration → Regional and language → Content language and translation. Another language uses that value only when it has no value of its own and the default language has one. An existing value is never replaced by another language, and a third language is never used as a substitute. Only the missing part falls back: a German name stays German even when the place of birth exists only in English. EDTF is put into words in the title language, also when the stored value was borrowed from the default language. Titles are stored for all languages at once, so "Interface text language selected for page" and "Author's preferred language" use the site's default language, as do "Not specified" and "Not applicable". A language in which the entity has no value at all gets no title of its own; the title in the default language is shown instead. The exception is a static text block translated into that language: when the title contains at least one path value, the language gets its own title from the translated text and the default-language values, e.g. "von Hans" on a German page for a name without a language tag. Changing the default language of a bundle rebuilds its titles; their stored copies follow on the next cron run.

Stored labels

Each Entity keeps a copy of its title in SQL so that lists and Views can sort by it. Saving an entity updates its own copy right away. When a title shows another entity (through an entity reference, a group or a disambiguated Path such as a place name), or when the title pattern of a Bundle changes, the copies of the affected entities are refreshed on the next cron run. A disambiguated value is only traced back to its entity if it was saved with its disambiguation, for example through the entity form; values saved without it are found after the entity is saved again.

Titles that are generated for display follow right away, without waiting for cron: the "Label (WissKI)" formatter and the WissKI Link Formatter with "Use title pattern" show the new title as soon as the embedded entity is saved. "Label (WissKI)" can also show EDTF dates in the title as readable text; see Dates in labels. The page heading of an entity uses its stored copy and follows after the next cron run. After updating WissKI, run the database updates (drush updb) once, so that titles cached before the update are rebuilt with these dependencies.