# [Title] on an entity

> `[Title]` on an entity says what each of its records is called — the line a notification, a search result or a link shows for it. `Records.Title(x)` answers it for any row.

<!-- id: entity-title · area: entity · stability: stable · html: https://osysharp.com/reference/entity/title/ -->

## Summary        {#summary}
`[Title(Number, Subject)]` on an entity names what each of its records is called: here its number and subject, joined
with " · ". A template says it in your own words — `[Title($"#{Number} · {Subject}")]`. Anything that shows a record it
did not declare — a notification's line, a feedback comment, a link — asks [`Records.Title(x)`](https://osysharp.com/reference/stdlib/records/), and
gets this.

## Signature      {#signature}
```osy syntax
[Title(Member1, Member2, …)]          // the members' values, joined with " · ", empty ones left out
[Title($"#{Number} · {Subject}")]     // an interpolated template over the record's own members
entity <Name> { … }
```

## Description    {#description}

### What is a record called without one?   {#default}
Its first `[Required]` text member — a `Name`, a `Title`, a `Subject` is usually exactly right, which is why most
entities need no `[Title]` at all. With none, its type's noun ("Ticket").

### Does a derived type inherit it?   {#inherited}
Yes. A type with no `[Title]` of its own is called by its nearest ancestor's; one of its own replaces it.

### Is it translated?   {#i18n}
The values are the record's own; the literal words in a template are not translated yet. Keep a template to
punctuation and numbers (`#{Number} · {Subject}`) where the app speaks more than one language.

### Where is it on the page?   {#page}
`[Title]` on a page component is the same idea for a route — its name, for chrome that names a route. On an entity it
names each record.

## Examples       {#examples}

```osy title="members joined, a template, and the default" test app=entity-title
Counter OrderNumber = new() { Start = 1000 };

/// "#1042 · Two city bikes"
[Title($"#{Number} · {Summary}")]
entity Order {
  [Counter(OrderNumber)] int Number;
  [Required, MaxLength(200)] string Summary;
  security { allow read, create when IsAuthenticated; }
}

/// "Ada Lovelace · London"
[Title(Name, City)]
entity Customer {
  [Required, MaxLength(100)] string Name;
  [MaxLength(100)] string City = "";
  security { allow read, create when IsAuthenticated; }
}

/// No [Title]: called by its first required text — "Spring catalogue".
entity Catalogue {
  [Required, MaxLength(100)] string Label;
  security { allow read, create when IsAuthenticated; }
}

public string Called(Order o, Customer c, Catalogue k) {
  return Records.Title(o) + " | " + Records.Title(c) + " | " + Records.Title(k);
}
```

## See also       {#see-also}
- [Records — what any record is called, where it opens, who may read it](https://osysharp.com/reference/stdlib/records/) — `Records.Title`, `Link`, `Noun` and `MayRead`, for any record
- [Entity](https://osysharp.com/reference/types/entity/) — a reference to a record of any type, which shows its title
- [entity](https://osysharp.com/reference/entity/declaration/) — the `entity` declaration itself
