Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 104 additions & 18 deletions docs/administration/content_organization/content_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,100 @@

Even if your content type defines a field intended as a name for the content item (for example, a title of an article or product name), don't confuse it with this Name, which is a piece of metadata, not a field.

**Identifier** – an identifier for internal use in configuration, for example, files, templates, or PHP code.
It must be unique, can only contain lowercase letters, digits, and underscores (it's mandatory and the maximum length is 50 characters).

**Description** – a detailed description of the content type (optional).

<a id="content-name-pattern"></a>**Content name pattern** – a pattern that defines what name a new content item based on this content type gets.
The pattern usually consists of field identifiers that tell the system which fields it should use when generating the name of a content item.
**Identifier** –
an identifier for internal use in, for example, configuration files, templates, or PHP code.
It must be unique, can only contain lowercase letters, digits, and underscores
(it's mandatory and the maximum length is 50 characters).

**Description** –
a detailed description of the content type (optional).

<a id="content-name-pattern"></a>
**Content name pattern** –
a pattern that defines what name a new content item based on this content type gets (optional).
The pattern usually consists of Field identifiers that tell the system which Fields it should use when generating the name of a content item.
Each field identifier has to be surrounded with angle brackets.
Text outside the angle brackets is included literally.
If no pattern is provided, the system automatically uses the first field (optional).

**URL alias name pattern** – a pattern which controls how the virtual URLs of the locations are generated when content items are created based on this content type.
If no pattern is provided, the system automatically uses the first field.

Check notice on line 49 in docs/administration/content_organization/content_types.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/administration/content_organization/content_types.md#L49

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/administration/content_organization/content_types.md", "range": {"start": {"line": 49, "column": 15}}}, "severity": "INFO"}

??? note "Pattern examples"

The following pattern takes the value of the field with the identifier `title` (which should be required):
```
<title>
```

The following pattern combines several field values:
```
<firstname> <lastname>
```

The following pattern takes the value of the field with the identifier `seo_title` (which is optional) if not empty,
else the value of the field with the identifier `short_title` (which is optional),
else it takes the one with identifier `title` (which is required):
```
<seo_title|short_title|title>
```

The following pattern takes the value of the field with the identifier `nickname` if not empty,
else it takes the ones with identifiers `firstname` and `lastname` with a space inbetween:
```
<nickname|(<firstname> <lastname>)>
```

- Input-output example:
- `fistname`: "*Alice*"
- `lastname`: "*Doe*"
- `nickname`: "" (empty)
- Generated content name: "*Alice Doe*"
- Input-output example:
- `fistname`: "*Robert*"
- `lastname`: "*Doe*"
- `nickname`: "*Bob*"
- Generated content name: "*Bob*"
- Input-output example:
- `fistname`: "" (empty)
- `lastname`: "*Doe*"
- `nickname`: "" (empty)
- Generated content name: " *Doe*" (notice the space before the last name, which is included literally in the pattern)

**Notice that the group in parenthesis is always final, it's used even if outputing an empty string and any other piped optional patern after it is always ignored.**

The following pattern combines several field values and literal text,
showing that you can use any characters outside the angle brackets:
```
<event_name> (<event_city>) | <event_begin> - <event_end>
```

Check warning on line 99 in docs/administration/content_organization/content_types.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/administration/content_organization/content_types.md#L99

[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/administration/content_organization/content_types.md", "range": {"start": {"line": 99, "column": 1}}}, "severity": "WARNING"}
- Input-output example:
- `event_name`: "*Ibexa Summit 2026*"
- `event_location`: "*Lisbon*"
- `event_begin`: "2026-02-05T09:00:00"
- `event_end`: "2026-02-06T16:30:00"
- Generated content name: "*Ibexa Summit 2026 (Lisbon) | Thu 2026-05-02 08:00:00 - Fri 2026-06-02 15:30:00*" (notice that the date and time where moved from GMT+1 to GMT)

**URL alias name pattern** –
a pattern which controls how the virtual URLs of the locations are generated when content items are created based on this content type (optional).

Check notice on line 108 in docs/administration/content_organization/content_types.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/administration/content_organization/content_types.md#L108

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/administration/content_organization/content_types.md", "range": {"start": {"line": 108, "column": 64}}}, "severity": "INFO"}

Check notice on line 108 in docs/administration/content_organization/content_types.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/administration/content_organization/content_types.md#L108

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/administration/content_organization/content_types.md", "range": {"start": {"line": 108, "column": 97}}}, "severity": "INFO"}
Only the last part of the virtual URL is affected.
The pattern works in the same way as the content name pattern.
Text outside the angle brackets is converted with the selected method of URL transformation.
If no pattern is provided, the system automatically uses the name of the content item itself (optional).
If no pattern is provided, the system automatically uses the name of the content item itself.

Check notice on line 111 in docs/administration/content_organization/content_types.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/administration/content_organization/content_types.md#L111

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/administration/content_organization/content_types.md", "range": {"start": {"line": 111, "column": 15}}}, "severity": "INFO"}
The resulting name is then [transformed using the slug converter to be part of the final URL alias (System URL)](url_management.md#url-alias-pattern-configuration).

Check notice on line 112 in docs/administration/content_organization/content_types.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/administration/content_organization/content_types.md#L112

[Ibexa.ByUsing] Prefer 'by using' or 'with' to plain 'using'.
Raw output
{"message": "[Ibexa.ByUsing] Prefer 'by using' or 'with' to plain 'using'.", "location": {"path": "docs/administration/content_organization/content_types.md", "range": {"start": {"line": 112, "column": 29}}}, "severity": "INFO"}

??? note "Pattern examples"

The following pattern combine several mandatory field values.
The slug converter use the out-of-the-box default `urlalias_lowercase` transformation.
```
<event_name> (<event_city>) | <event_begin> - <event_end>
```

Check warning on line 121 in docs/administration/content_organization/content_types.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/administration/content_organization/content_types.md#L121

[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[Ibexa.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/administration/content_organization/content_types.md", "range": {"start": {"line": 121, "column": 1}}}, "severity": "WARNING"}
- Input-output example:
- `event_name`: "*Ibexa Summit 2026*"
- `event_location`: "*Lisbon*"
- `event_begin`: "2026-02-05T09:00:00"
- `event_end`: "2026-02-06T16:30:00"
- Generated URL alias name: "*Ibexa Summit 2026 (Lisbon) | Thu 2026-05-02 08:00:00 - Fri 2026-06-02 15:30:00*"
- Generated URL alias slug: `ibexa-summit-2026-lisbon-thu-2026-05-02-08-00-00-fri-2026-06-02-15-30-00`

!!! tip "Changing URL alias and content name patterns"

Expand All @@ -56,20 +134,28 @@

The old URL aliases continue to redirect to the same content items.

**Container** – a flag which indicates if content items based on this content type are allowed to have sub-items or not (mainly relevant for actions via the UI, not validated by every PHP API).
**Container** –
a flag which indicates if content items based on this content type are allowed to have sub-items or not

Check notice on line 138 in docs/administration/content_organization/content_types.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/administration/content_organization/content_types.md#L138

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/administration/content_organization/content_types.md", "range": {"start": {"line": 138, "column": 68}}}, "severity": "INFO"}
(mainly relevant for actions via the UI, not validated by every PHP API).

!!! note

This flag was added for convenience and only affects the interface.
In other words, it doesn't control any actual low-level logic, it simply controls the way the graphical user interface behaves.
In other words, it doesn't control any actual low-level logic,
it simply controls the way the graphical user interface behaves.

**Sort children by default by** – rule for sorting sub-items.
If the instances of this content type can serve as containers, their children are sorted according to what is selected here.
**Sort children by default by** –
rule for sorting sub-items.
If the instances of this content type can serve as containers,
their children are sorted according to what is selected here.

Check notice on line 150 in docs/administration/content_organization/content_types.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/administration/content_organization/content_types.md#L150

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/administration/content_organization/content_types.md", "range": {"start": {"line": 150, "column": 16}}}, "severity": "INFO"}

Check notice on line 150 in docs/administration/content_organization/content_types.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/administration/content_organization/content_types.md#L150

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/administration/content_organization/content_types.md", "range": {"start": {"line": 150, "column": 45}}}, "severity": "INFO"}

**Sort children by default in order** – another rule for sorting sub-items.
**Sort children by default in order** –
another rule for sorting sub-items.
This decides the sort order for the criterion chosen above.

<a id="default-content-availability"></a>**Make content available even with missing translations** – a flag which indicates if content items of this content type should be available even without a corresponding language version.
<a id="default-content-availability"></a>
**Make content available even with missing translations** –
a flag which indicates if content items of this content type should be available even without a corresponding language version.
See [Content availability](content_availability.md).

![Creating a new content type](admin_panel_new_content_type.png)
Expand Down
11 changes: 5 additions & 6 deletions docs/content_management/url_management/url_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@
cleanup_method: url_cleanup
```

| Option | Description |
|-----------------------|-----------------------------------------------------------------------------------------------------------|
| `transformation` | Indicates which pattern is used by default. |
| `separator` | Decides what separator is used. There are three types of separator available: dash, underscore and space. |
| `transformation_groups` | Contains the available patterns for URL generation. |
| Option | Description |
|--------------------------------------|-----------------------------------------------------------------------------------------------------------|
| `transformation` | Indicates which pattern is used by default. |

Check notice on line 180 in docs/content_management/url_management/url_management.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/url_management/url_management.md#L180

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/content_management/url_management/url_management.md", "range": {"start": {"line": 180, "column": 66}}}, "severity": "INFO"}
| `separator` | Decides what separator is used. There are three types of separator available: dash, underscore and space. |

Check notice on line 181 in docs/content_management/url_management/url_management.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/url_management/url_management.md#L181

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/content_management/url_management/url_management.md", "range": {"start": {"line": 181, "column": 65}}}, "severity": "INFO"}

Check warning on line 181 in docs/content_management/url_management/url_management.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/content_management/url_management/url_management.md#L181

[Ibexa.UnclearAntecedent] Instead of 'There are', try starting this sentence with a specific subject and verb.
Raw output
{"message": "[Ibexa.UnclearAntecedent] Instead of 'There are', try starting this sentence with a specific subject and verb.", "location": {"path": "docs/content_management/url_management/url_management.md", "range": {"start": {"line": 181, "column": 74}}}, "severity": "WARNING"}
| <nobr>`transformation_groups`</nobr> | Contains the available patterns for URL generation. |

A transformation group consists of an array of commands (see [all available commands](https://github.com/ibexa/core/tree/5.0/src/lib/Resources/slug_converter/transformations)) and a [`cleanupText`](https://github.com/ibexa/core/blob/5.0/src/lib/Persistence/Legacy/Content/UrlAlias/SlugConverter.php#L286).

Expand All @@ -202,7 +202,6 @@

Before you apply the command, back up your database and make sure it's not modified while the command is running.


Execute the following command to regenerate aliases:

``` bash
Expand Down
Loading