From ead567974ccf486e550b258516ed08b2ba463158 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 8 Oct 2024 18:22:01 +0200 Subject: [PATCH 1/7] content_types.md: ADd pattern examples; format Markdown --- .../content_organization/content_types.md | 89 ++++++++++++++++--- 1 file changed, 77 insertions(+), 12 deletions(-) diff --git a/docs/administration/content_organization/content_types.md b/docs/administration/content_organization/content_types.md index 43f08cbb0d..bf6033e00a 100644 --- a/docs/administration/content_organization/content_types.md +++ b/docs/administration/content_organization/content_types.md @@ -30,13 +30,66 @@ Each content type is characterized by a set of metadata which define the general Note that 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), do not confuse it with this Name, which is a piece of metadata, not a Field. -**Identifier** – an identifier for internal use in configuration files, templates, PHP code, etc. It must be unique, can only contain lowercase letters, digits and underscores; the maximum length is 50 characters. (Mandatory.) - -**Description** – a detailed description of the content type. (Optional.) - -**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. Each Field identifier has to be surrounded with angle brackets. Text outside the angle brackets will be included literally. If no pattern is provided, the system will automatically use the first Field. (Optional.) - -**URL alias name pattern** – a pattern which controls how the virtual URLs of the Locations will be generated when content items are created based on this content type. Note that 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 will be converted using the selected method of URL transformation. If no pattern is provided, the system will automatically use the name of the content item itself. (Optional.) +**Identifier** – +an identifier for internal use in configuration files, templates, PHP code, etc. +It must be unique, can only contain lowercase letters, digits and underscores; +the maximum length is 50 characters. (Mandatory.) + +**Description** – +a detailed description of the content type. (Optional.) + + +**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. +Each Field identifier has to be surrounded with angle brackets. +Text outside the angle brackets will be included literally. +If no pattern is provided, the system will automatically use the first Field. (Optional.) + +??? note "Pattern examples" + + The following pattern takes the value of the field with the identifier `title` (which is required): + ``` + + ``` + + 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*" + + **Notice that you won't be able to obtain a vertical bar `|` or parentheses in the generated names as they are special characters.** + + +**URL alias name pattern** – +a pattern which controls how the virtual URLs of the Locations will be generated when content items are created based on this content type. +Note that 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 will be converted using the selected method of URL transformation. +If no pattern is provided, the system will automatically use the name of the content item itself. (Optional.) !!! tip "Changing URL alias and Content name patterns" @@ -46,17 +99,29 @@ Each content type is characterized by a set of metadata which define the general The old URL aliases will 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 +(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. + 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. -**Sort children by default by** – rule for sorting sub-items. If the instances of this content type can serve as containers, their children will be 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 will be sorted according to what is selected here. -**Sort children by default in order** – another rule for sorting sub-items. This decides the sort order for the criterion chosen above. +**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. See [Content availability](content_availability.md). +<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) From c8be9cf078a5b9576c6837cb4f27d8158f4e6ce9 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:53:51 +0200 Subject: [PATCH 2/7] Present tense and other text fixes --- .../content_organization/content_types.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/administration/content_organization/content_types.md b/docs/administration/content_organization/content_types.md index bf6033e00a..7582da6f4b 100644 --- a/docs/administration/content_organization/content_types.md +++ b/docs/administration/content_organization/content_types.md @@ -32,8 +32,8 @@ Each content type is characterized by a set of metadata which define the general **Identifier** – an identifier for internal use in configuration files, templates, PHP code, etc. -It must be unique, can only contain lowercase letters, digits and underscores; -the maximum length is 50 characters. (Mandatory.) +It must be unique, can only contain lowercase letters, digits, and underscores. +The maximum length is 50 characters. (Mandatory.) **Description** – a detailed description of the content type. (Optional.) @@ -43,7 +43,7 @@ a detailed description of the content type. (Optional.) 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. Each Field identifier has to be surrounded with angle brackets. -Text outside the angle brackets will be included literally. +Text outside the angle brackets is included literally. If no pattern is provided, the system will automatically use the first Field. (Optional.) ??? note "Pattern examples" @@ -86,10 +86,10 @@ If no pattern is provided, the system will automatically use the first Field. (O **URL alias name pattern** – -a pattern which controls how the virtual URLs of the Locations will be generated when content items are created based on this content type. -Note that 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 will be converted using the selected method of URL transformation. -If no pattern is provided, the system will automatically use the name of the content item itself. (Optional.) +a pattern which controls how the virtual URLs of the Locations is generated when content items are created based on this content type. +Only the last part of the virtual URL is affected. The pattern works in the same way as the Content name pattern. +Text is converted using the selected method of URL transformation. +If no pattern is provided, the system automatically uses the name of the content item itself. (Optional.) !!! tip "Changing URL alias and Content name patterns" @@ -112,7 +112,7 @@ a flag which indicates if content items based on this content type are allowed t **Sort children by default by** – rule for sorting sub-items. If the instances of this content type can serve as containers, -their children will be sorted according to what is selected here. +their children are sorted according to what is selected here. **Sort children by default in order** – another rule for sorting sub-items. From 1a9e0fddcab58cdbe8d7adb8e2f9ad275da62f93 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 1 Jun 2026 18:58:16 +0200 Subject: [PATCH 3/7] content_types.md: update notice --- docs/administration/content_organization/content_types.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/administration/content_organization/content_types.md b/docs/administration/content_organization/content_types.md index 82bffcc8d1..27f87aa9d9 100644 --- a/docs/administration/content_organization/content_types.md +++ b/docs/administration/content_organization/content_types.md @@ -83,9 +83,13 @@ If no pattern is provided, the system automatically uses the first field. - `lastname`: "*Doe*" - `nickname`: "*Bob*" - Generated content name: "*Bob*" + - Input-output example: + - `fistname`: "" (empty) + - `lastname`: "*Doe*" + - `nickname`: "" (empty) + - Generated content name: " *Doe*" - **Notice that you won't be able to obtain a vertical bar `|` or parentheses in the generated names as they are special characters.** - + **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.** **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). From 24fe803429fee5ce699acbca369239826d78e025 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 1 Jun 2026 19:28:34 +0200 Subject: [PATCH 4/7] content_types.md: reword --- docs/administration/content_organization/content_types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/administration/content_organization/content_types.md b/docs/administration/content_organization/content_types.md index 27f87aa9d9..f07aa0f5a7 100644 --- a/docs/administration/content_organization/content_types.md +++ b/docs/administration/content_organization/content_types.md @@ -50,7 +50,7 @@ If no pattern is provided, the system automatically uses the first field. ??? note "Pattern examples" - The following pattern takes the value of the field with the identifier `title` (which is required): + The following pattern takes the value of the field with the identifier `title` (which should be required): ``` <title> ``` From e5dd69718af5c92eedf5b5a0c01dc33e72b844d9 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 1 Jun 2026 19:29:38 +0200 Subject: [PATCH 5/7] content_types.md: reword --- docs/administration/content_organization/content_types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/administration/content_organization/content_types.md b/docs/administration/content_organization/content_types.md index f07aa0f5a7..1cb79c0d7e 100644 --- a/docs/administration/content_organization/content_types.md +++ b/docs/administration/content_organization/content_types.md @@ -87,7 +87,7 @@ If no pattern is provided, the system automatically uses the first field. - `fistname`: "" (empty) - `lastname`: "*Doe*" - `nickname`: "" (empty) - - Generated content name: " *Doe*" + - 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.** From 3082578fde0c31b578671bd5940aa8c53ec77df7 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 1 Jun 2026 19:31:51 +0200 Subject: [PATCH 6/7] content_types.md: reword --- docs/administration/content_organization/content_types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/administration/content_organization/content_types.md b/docs/administration/content_organization/content_types.md index 1cb79c0d7e..4d9dcb9584 100644 --- a/docs/administration/content_organization/content_types.md +++ b/docs/administration/content_organization/content_types.md @@ -33,7 +33,7 @@ It can consist of letters, digits, spaces, and special characters (it's mandator 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, for example, configuration files, templates, PHP code, etc. +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). From 927b331a7b1dfd78afd672c2c84fc32a1a9815da Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 2 Jun 2026 09:58:32 +0200 Subject: [PATCH 7/7] Link to slug converter --- .../content_organization/content_types.md | 31 ++++++++++++++++++- .../url_management/url_management.md | 11 +++---- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/docs/administration/content_organization/content_types.md b/docs/administration/content_organization/content_types.md index 4d9dcb9584..59e6d9d7ea 100644 --- a/docs/administration/content_organization/content_types.md +++ b/docs/administration/content_organization/content_types.md @@ -91,12 +91,41 @@ If no pattern is provided, the system automatically uses the first field. **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> + ``` + + - 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). 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. +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). + +??? 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> + ``` + + - 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" diff --git a/docs/content_management/url_management/url_management.md b/docs/content_management/url_management/url_management.md index 20af85356b..110a00b4b2 100644 --- a/docs/content_management/url_management/url_management.md +++ b/docs/content_management/url_management/url_management.md @@ -175,11 +175,11 @@ ibexa: 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. | +| `separator` | Decides what separator is used. There are three types of separator available: dash, underscore and space. | +| <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). @@ -202,7 +202,6 @@ Use it when: 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