From e6325057acd58f211578da2acc71fe641595130e Mon Sep 17 00:00:00 2001 From: Arjo Bruijnes Date: Wed, 5 Jun 2024 16:22:57 +0200 Subject: [PATCH 1/5] Refer to appropriate version in Mendix 8 and 9 documentation --- .../pluggable-parent-8/property-types-pluggable-widgets-8.md | 2 +- .../pluggable-parent-9/pluggable-widgets-property-types-9.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-parent-8/property-types-pluggable-widgets-8.md b/content/en/docs/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-parent-8/property-types-pluggable-widgets-8.md index 031100fc52a..c26fc119191 100644 --- a/content/en/docs/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-parent-8/property-types-pluggable-widgets-8.md +++ b/content/en/docs/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-parent-8/property-types-pluggable-widgets-8.md @@ -403,7 +403,7 @@ Then the Studio Pro UI for the property appears like this: ### 4.2 TextTemplate{#texttemplate} -The TextTemplate property allows a user to configure a translatable text template similar to the [Caption](/refguide/text/#caption) of a text widget. +The TextTemplate property allows a user to configure a translatable text template similar to the [Caption](/refguide8/text/#caption) of a text widget. If a `dataSource` attribute is not specified, or if a `dataSource` attribute is specified but the data source is not configured by the user, the interpolated string will be passed to the client component as `DynamicValue`. diff --git a/content/en/docs/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-parent-9/pluggable-widgets-property-types-9.md b/content/en/docs/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-parent-9/pluggable-widgets-property-types-9.md index ec127021ad0..a86b3d87d63 100644 --- a/content/en/docs/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-parent-9/pluggable-widgets-property-types-9.md +++ b/content/en/docs/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-parent-9/pluggable-widgets-property-types-9.md @@ -430,7 +430,7 @@ Then the Studio Pro UI for the property appears like this: ### 4.2 TextTemplate {#texttemplate} -The TextTemplate property allows a user to configure a translatable text template similar to the [Caption](/refguide/text/#caption) of a text widget. +The TextTemplate property allows a user to configure a translatable text template similar to the [Caption](/refguide9/text/#caption) of a text widget. If a `dataSource` attribute is not specified, the interpolated string will be passed to the client component as `DynamicValue`. From de278c86cee2e23b6022e04d4d14e331b0ada1c4 Mon Sep 17 00:00:00 2001 From: Arjo Bruijnes Date: Mon, 24 Jun 2024 13:28:44 +0200 Subject: [PATCH 2/5] Apply the new Text Template guide to Text Widget's Caption --- .../modeling/pages/text-widgets/text.md | 65 ++++++++++++------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/content/en/docs/refguide/modeling/pages/text-widgets/text.md b/content/en/docs/refguide/modeling/pages/text-widgets/text.md index ed212309693..bc813add613 100644 --- a/content/en/docs/refguide/modeling/pages/text-widgets/text.md +++ b/content/en/docs/refguide/modeling/pages/text-widgets/text.md @@ -36,20 +36,23 @@ Styling: ### 3.1 General Section {#general} -#### 3.1.1 Caption {#caption} -**Caption** defines a text that will be shown. The caption can contain parameters that are written between braces, for example, {1}. +#### 3.1 Caption {#caption} -For more information on using parameters, see the [Parameters](#parameters) section below. +**Caption** defines the text that will be shown. It supports dynamic text using templating. The final text is determined by the given [**Template**](#caption-template), [**Parameters**](#caption-parameters), and [**Fallback Text**](#caption-fallback), which can be found in the 'Edit Caption' dialog box. The dialog box can be opened in two ways: -#### 3.1.2 Parameters {#parameters} +* From the properties sidebar: double-click the property (for example, "Caption") or click the "more" ellipsis (...) +* From the widget properties dialog box: click the **Edit ...** button next to the property's textbox -Parameters are attributes or expressions whose values will be displayed as part of the text defined in the **Caption** setting. To view **Parameters**, do one of the following: +{{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/caption-edit-button.png" alt="Opening Parameters" width="450" >}} -* Double-click the **Caption** setting in properties -* Double-click the text widget on the page and click **Edit** in the **General** section > **Caption**: +##### 3.1.1 Template {#caption-template} - {{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/caption-edit-button.png" alt="Opening Parameters" width="450" class="no-border" >}} +The **Caption** can be made dynamic by placing placeholders in the **Template**. Placeholders must follow the format `{i}`, where _i_ is the **Index** of a specific parameter from the list of [parameters](#caption-parameters). Parameters can be referenced multiple times, and can be referenced out of order. + +##### 3.1.2 Parameters {#caption-parameters} + +Parameters define what data is inserted into the template and how it is formatted. Parameters can refer to object attributes or expressions. Editing parameters is done in the 'Edit Caption' dialog box. Parameters have the following settings: @@ -57,41 +60,55 @@ Parameters have the following settings: * **Value** – an attribute or an expression value to be displayed * **Format** – a format in which the value will be displayed (only for attributes) - {{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/parameter-settings.png" alt="Parameter Settings" width="450" class="no-border" >}} +{{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/parameter-settings.png" alt="Parameter Settings" width="450" >}} {{% alert color="info" %}} You can use the formatter functions in the expression editor when using expressions. For more information, see [this list](/refguide/expressions/#expressions-formatter-functions). {{% /alert %}} -##### 3.1.1.1 Adding New Parameters +###### 3.1.2.1 Adding New Parameters -To use parameters, do the following: +To be able to use parameters, the Text widget must be in the context of an entity such as a [Data widget](/refguide/data-view), [Snippet parameter](http://localhost:1313/refguide/snippet/#parameters), or [Page parameter](/refguide/page-properties/#parameters). To use parameters, do the following: -1. Place the **Text** widget in a context of an entity, as in, inside a [data container](/refguide/data-widgets/). -2. Double-click the **Caption** setting in the text widget properties. -3. In the **Edit Caption** dialog box > **Parameters** section click **New**: +1. Open the properties for the Text widget. +1. Click the **Edit ...** button of the PROPERTY_NAME to open its dialog box. +1. In the **Parameters** section, click **New**: - {{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/adding-parameter.png" alt="Adding New Parameter" width="450" class="no-border" >}} + {{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/adding-parameter.png" alt="Adding New Parameter" width="450" >}} -4. In the **Edit Template Parameter** dialog box, click **Select**, choose an attribute and confirm your choice. -5. In the **Caption** setting, write the text you would like to display and type the **Index** of the parameter you would like to include within braces. In the example below, to include the title of the book, amount of pages it has and the year it was published, you need to use indexes {1} for the *Title* attribute, {2} for the *NrOfPages* attribute and {3} for the *DatePublished* attribute: +1. In the **Edit Template Parameter** dialog box, click **Select**, choose an attribute, and confirm your choice. +1. Edit the template and add a placeholder that matches the index of your parameter (for example `{1}`). - {{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/parameters-example.png" alt="Parameter Example" width="450" class="no-border" >}} +In the example below, the placeholder `{1}` corresponds to the **Title** attribute, `{2}` to **NrOfPages**, and `{3}` to **DatePublished**: -6. In the **Fallback text** setting, write the text you would like to display when no context object is available from the surrounding data widget: +{{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/parameters-example.png" alt="Parameter Example" width="450" >}} - {{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/fallback-text-example.png" alt="Fallback Text Example" width="450" class="no-border" >}} -##### 3.1.1.2 Performing Other Actions on Parameters +###### 3.1.2.2 Performing Other Actions on Parameters In addition to adding new parameters, you can perform the following actions on parameters: -* **Delete** – to delete a parameter click Delete or press Delete on your keyboard -* **Edit** – double-click a parameter to edit it or click Edit +* **Delete** – to delete a parameter click **Delete** or press Delete on your keyboard +* **Edit** – double-click a parameter to edit it or click **Edit** * **Move up** – to move a parameter up in the list of parameters and also to change its index, click **Move up** * **Move down** – to move a parameter down in the list of parameters and also to change its index, click **Move down** - {{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/parameter-actions.png" alt="Parameter Actions" width="450" class="no-border" >}} +{{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/parameter-actions.png" alt="Parameter Actions" width="450" >}} + + +##### 3.1.3 Fallback Text {#caption-fallback} + +The fallback text is shown when the datasource of the **Parameters** is empty or unavailable. + +Empty attributes used as parameters do not cause the fallback text to be shown. Instead the template is rendered as normal and the placeholders for the empty parameters are substituted by empty strings. + +For example: The template `Hello, {1}!` with the fallback text _"Nobody to greet."_ would get rendered as follows: + +| Scenario | Rendered text | +| ---------------- | ------------------ | +| Filled attribute | "Hello, World!" | +| Empty attribute | "Hello, !" | +| Missing object | "Nobody to greet." | #### 3.1.3 Render Mode From c3dd33a7bb80a29661438bbd33dfae6a5e5aa17b Mon Sep 17 00:00:00 2001 From: ConnorLand <47385345+ConnorLand@users.noreply.github.com> Date: Fri, 23 Oct 2026 13:48:16 +0200 Subject: [PATCH 3/5] remove numbers in headers --- .../en/docs/refguide/modeling/pages/text-widgets/text.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/en/docs/refguide/modeling/pages/text-widgets/text.md b/content/en/docs/refguide/modeling/pages/text-widgets/text.md index bf6999af8e6..633eed7c7d7 100644 --- a/content/en/docs/refguide/modeling/pages/text-widgets/text.md +++ b/content/en/docs/refguide/modeling/pages/text-widgets/text.md @@ -47,11 +47,11 @@ Styling: {{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/caption-edit-button.png" alt="Opening Parameters" width="450" >}} -##### 3.1.1 Template {#caption-template} +##### Template {#caption-template} The **Caption** can be made dynamic by placing placeholders in the **Template**. Placeholders must follow the format `{i}`, where _i_ is the **Index** of a specific parameter from the list of [parameters](#caption-parameters). Parameters can be referenced multiple times, and can be referenced out of order. -##### 3.1.2 Parameters {#caption-parameters} +##### Parameters {#caption-parameters} Parameters define what data is inserted into the template and how it is formatted. Parameters can refer to object attributes or expressions. Editing parameters is done in the 'Edit Caption' dialog box. @@ -96,7 +96,7 @@ In addition to adding new parameters, you can perform the following actions on p {{< figure src="/attachments/refguide/modeling/pages/text-widgets/text/parameter-actions.png" alt="Parameter Actions" width="450" >}} -##### 3.1.3 Fallback Text {#caption-fallback} +##### Fallback Text {#caption-fallback} The fallback text is shown when the datasource of the **Parameters** is empty or unavailable. From ec620827ac276853beefadf02aacd3682e0b9dc3 Mon Sep 17 00:00:00 2001 From: ConnorLand <47385345+ConnorLand@users.noreply.github.com> Date: Fri, 23 Oct 2026 13:54:47 +0200 Subject: [PATCH 4/5] fix error --- content/en/docs/refguide/modeling/pages/text-widgets/text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/refguide/modeling/pages/text-widgets/text.md b/content/en/docs/refguide/modeling/pages/text-widgets/text.md index 633eed7c7d7..dbed8f29979 100644 --- a/content/en/docs/refguide/modeling/pages/text-widgets/text.md +++ b/content/en/docs/refguide/modeling/pages/text-widgets/text.md @@ -69,7 +69,7 @@ You can use the formatter functions in the expression editor when using expressi ##### Adding New Parameters -To be able to use parameters, the Text widget must be in the context of an entity such as a [Data widget](/refguide/data-view), [Snippet parameter](http://localhost:1313/refguide/snippet/#parameters), or [Page parameter](/refguide/page-properties/#parameters). To use parameters, do the following: +To be able to use parameters, the Text widget must be in the context of an entity such as a [Data widget](/refguide/data-view/), [Snippet parameter](http://localhost:1313/refguide/snippet/#parameters), or [Page parameter](/refguide/page-properties/#parameters). To use parameters, do the following: 1. Open the properties for the Text widget. 1. Click the **Edit ...** button of the PROPERTY_NAME to open its dialog box. From 2e2f4e9b3e894031d40df7c7a99fe5e397da1da1 Mon Sep 17 00:00:00 2001 From: ConnorLand <47385345+ConnorLand@users.noreply.github.com> Date: Fri, 23 Oct 2026 14:04:40 +0200 Subject: [PATCH 5/5] formatting edits --- .../en/docs/refguide/modeling/pages/text-widgets/text.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/en/docs/refguide/modeling/pages/text-widgets/text.md b/content/en/docs/refguide/modeling/pages/text-widgets/text.md index dbed8f29979..57938bdb144 100644 --- a/content/en/docs/refguide/modeling/pages/text-widgets/text.md +++ b/content/en/docs/refguide/modeling/pages/text-widgets/text.md @@ -38,10 +38,10 @@ Styling: #### Caption {#caption} -**Caption** defines the text that will be shown. It supports dynamic text using templating. The final text is determined by the given [**Template**](#caption-template), [**Parameters**](#caption-parameters), and [**Fallback Text**](#caption-fallback), which can be found in the 'Edit Caption' dialog box. The dialog box can be opened in two ways: +**Caption** defines the text that will be shown. It supports dynamic text using templating. The final text is determined by the given [Template](#caption-template), [Parameters](#caption-parameters), and [Fallback Text](#caption-fallback), which can be found in the 'Edit Caption' dialog box. The dialog box can be opened in two ways: * From the properties sidebar: double-click the property (for example, "Caption") or click the "more" ellipsis (...) -* From the widget properties dialog box: click the **Edit ...** button next to the property's textbox +* From the widget properties dialog box: click the **Edit** button next to the property's textbox #### Parameters {#parameters} @@ -102,7 +102,7 @@ The fallback text is shown when the datasource of the **Parameters** is empty or Empty attributes used as parameters do not cause the fallback text to be shown. Instead the template is rendered as normal and the placeholders for the empty parameters are substituted by empty strings. -For example: The template `Hello, {1}!` with the fallback text _"Nobody to greet."_ would get rendered as follows: +For example: The template `Hello, {1}!` with the fallback text `"Nobody to greet."` would get rendered as follows: | Scenario | Rendered text | | ---------------- | ------------------ |