> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# title.dat configuration

> Structure of the title list title.dat: columns, title codes, and the difference between the title in the selection list and the title in the salutation line.

The `title.dat` configuration defines the titles the buyer can choose from when entering their billing address and an alternative delivery address. It also determines how the selected title later appears in the salutation line.

![Konfig Titel](https://mintcdn.com/websaleag-44ee7ea6/qpKXKLTjn0wDjacH/images/konfig_titel.png?fit=max\&auto=format\&n=qpKXKLTjn0wDjacH\&q=85\&s=b80ebc9cb5eef096c6c027d635f29450)

> [!NOTE]
>
> You define the form of the salutation itself in the `salutation.dat` configuration. That is also where you determine whether the title appears in the salutation line at all.

Reference: salutation.dat configuration · Guide: Defining how salutations and titles are formed, Selection lists for address data · Basics: Configuration basics

## Where the file is located

The shop looks for the file in two locations, in this order:

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
konfiguration/<Subshop-ID>/title.dat
konfiguration/title.dat
```

The subshop's file takes precedence. If it is missing, the shop falls back to the shared file one level up.

> [!WARNING]
>
> One of the two files must exist, and the file found must not be empty. Otherwise, the shop aborts with an error message.
>
> Note one difference from `salutation.dat`: an **empty** file in the subshop directory does **not** trigger a fallback to the shared file for `title.dat`, but leads directly to an abort. So delete the file in the subshop directory entirely instead of emptying its content.

## Structure

The file is tab-separated. The first row contains the column names, and from the second row on, each title has its own row.

| Column | Meaning |
| - | - |
| `Title` | the entry as it appears in the title selection list |
| `Country` | country code for building different title selection lists depending on the shop language |
| `Code` | the title code, for example `$1` for "Rechtsanwalt" (attorney) |
| `Text` | the title in the form in which it appears in the **salutation line** |
| `LastNameInSalutation` | whether the last name is shown in the salutation line. `X` shows it, empty suppresses it |

> [!NOTE]
>
> Columns are identified by their names in the header row, not by their position. This means the column order is up to you, but the spelling of the names is not. The shop does not evaluate more than ten columns.
>
> The module for forms and inquiries aborts with a warning if one of the five columns is missing from the header row.

### `Title` and `Text` are not the same

This is the point where this file is most often misunderstood.

`Title` is the written form for the selection list and for the address data. `Text` is the spoken form for the salutation line. The `$W-Title` placeholder in `salutation.dat` is replaced by the content of the **`Text`** column, not by `Title`.

This lets you cleanly separate long academic titles:

| `Title` | `Text` | Result in the salutation line |
| - | - | - |
| `Prof.Dr. rer.nat. Dr.` | `Professor` | "Sehr geehrter Herr Professor Müller" |
| `Dr. habil` | `Dr.` | "Sehr geehrter Herr Dr. Müller" |

### The first entry

The second row of the file, that is, the first data entry, is intended for buyers who have no title or do not want to provide one. Its `Title` column stays empty so that the selection list starts with an empty entry.

> [!NOTE]
>
> For this empty entry, the shop prefixes the title code in the form value with `empty_`, for example `empty_00`. It removes the prefix again during evaluation.

## The title code

The title code must remain the same across all country codes. If "Rechtsanwalt" uses code `$1` in the German shop, then "Advocate" must use the same code `$1` in the English shop.

The reason lies in further processing: the code is stored, not the text. Only if the code has the same meaning across all languages can first name and title be validated correctly later and a matching salutation be generated.

> [!NOTE]
>
> The code is free text. The dollar sign is a convention, not a requirement, and the shop compares the code case-insensitively.

## Example

A `title.dat` for German and English, showing the German block here. The first data row is the entry without a title.

| Title | Country | Code | Text | LastNameInSalutation |
| - | - | - | - | - |
| | `DEU` | `00` | `0` | `0` |
| Rechtsanwalt | `DEU` | `$1` | `0` | `X` |
| Ing. | `DEU` | `$2` | `0` | `X` |
| Prof.Dr. rer.nat. Dr. | `DEU` | `$3` | Professor | `0` |
| Dr. habil | `DEU` | `$4` | Dr. | `X` |
| Dipl.-Ing. | `DEU` | `1` | `0` | `X` |

> [!WARNING]
>
> In this example, there is a `0` in several places where the column description refers to an empty cell. This notation is taken unchanged from the previous documentation.
>
> When you create a new `title.dat`, leave these cells empty if in doubt. Leave an existing file with `0` unchanged as long as the salutation lines in the shop look correct.

## The salutation line

You define how the title ends up in the salutation line in `salutation.dat` via the `CompleteSalutation` column. This file contributes two things:

The `Text` column provides the content for the `$W-Title` placeholder.

The `LastNameInSalutation` column decides whether the `$W-LastName` placeholder is filled with the last name or left empty. This applies even if `salutation.dat` includes the placeholder. A title can therefore suppress the last name in the salutation.

> [!NOTE]
>
> After inserting the placeholders, the shop collapses double spaces and removes a trailing space. A suppressed title or last name therefore does not leave a gap in the salutation line.

Reference: salutation.dat configuration

> [!NOTE]
>
> You set the language your shop uses in the `Basic` section of the `shop.config`.

Reference: shop.config, basics and technology

## Changes to the title list

The shop reads the file once per request. Changes therefore take effect with the next page request.

A row you remove disappears from the selection list. For addresses that have already stored the corresponding title code, the shop then no longer finds a matching entry and outputs neither the title nor the title text. It is therefore best to change only the text and delete only rows whose code was never in use.


## Related topics

- [salutation.dat configuration](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/konfiguration-salutation-dat.md)
- [Configuration: fundamentals](https://dokumentation.websale.de/en/v8s/grundlagen-konfiguration/konfiguration-grundlagen.md)
- [Configuration migration](https://dokumentation.websale.de/en/migration/migration-websale-v8s-neue-version/konfiguration-migration.md)
- [Configuration types](https://dokumentation.websale.de/en/v8s/grundlagen-konfiguration/konfigurations-typen.md)
- [Configuration currency.dat](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/konfiguration-currency-dat.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.