Skip to content

Commit 4e0b467

Browse files
authored
Merge pull request #10859 from WimJongeneel/primitive-page-parameters-url
Document primitive page parameter support in page URLs
2 parents 5eb16e3 + 2b9223b commit 4e0b467

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

content/en/docs/refguide/modeling/pages/page/page-properties.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,21 @@ By default, **Autofocus** is set to "Off" for any newly created pages. For backw
7777

7878
A page's URL allows end users to directly navigate to the page (for example, from external links or bookmarks). It will be shown in the address bar of the browser when you visit the page. When navigating to a page without a URL configured, the last visited URL is shown. Note that the full URL of the page will be the base URL of your application followed by `/p/` and then by the configured URL of the page (for example, `http://example.mendixcloud.com/p/home_page`).
7979

80-
Pages with parameters can also have URLs. For those pages, all page parameters must be present in the URL. To do this, define which attribute of each page parameter you want to be used in the URL. The syntax for this is the name of the page parameter, a `/`, and then the name of the attribute that should be used placed between curly brackets.
80+
{{% alert color="info" %}}
81+
The `/p/` URL prefix can be configured in [runtime settings](/refguide/runtime-tab/#url-prefix).
82+
{{%/alert %}}
83+
84+
Pages with parameters can also have URLs. For those pages, all page parameters must be present in the URL. The URL syntax depends on the type of parameter:
8185

82-
For example, in the URL `product/{Product/Name}` the `Name` attribute of the page parameter `Product` will be used in the URL (in a browser, the URL appears as `http://example.mendixcloud.com/p/product/hammer`). Any attribute of type `Boolean`, `Decimal`, `Enumeration`, `Integer`, `Long`, or `String` can be used in the URL.
86+
* **Entity parameters** – Use the parameter name, a `/`, and then the attribute name enclosed in curly brackets: `{ParameterName/Attribute}`. Any attribute of type `Boolean`, `Decimal`, `Enumeration`, `Integer`, `Long`, or `String` can be used. For example, in the URL `product/{Product/Name}`, the `Name` attribute of the page parameter `Product` will be used (in a browser, the URL appears as `http://example.mendixcloud.com/p/product/hammer`).
87+
* **Primitive parameters** – Primitive parameters are page parameters of a simple type (such as `String` or `Integer`) rather than an entity type. Use the parameter name enclosed in curly brackets: `{ParameterName}`. For example, in the URL `product/{ProductName}`, the value of the primitive page parameter `ProductName` will be used.
8388

84-
Next to this, you can use `Id` as an attribute to include the identifier of the entity in the URL. This would appear as `product/{Product/Id}` for example. In the page URL dialog box, the configured URL is shown together with an example URL (with example values filled in for the parameters), and also shows which XPath queries the runtime will use to retrieve the page parameters. See this example URL in a dialog box:
89+
Additionally, you can use `Id` as an attribute to include the identifier of the entity in the URL. This would appear as `product/{Product/Id}`, for example. In the page URL dialog box, the configured URL is shown together with an example URL (with example values filled in for the parameters), and also shows which XPath queries the runtime will use to retrieve the page parameters. See this example URL in a dialog box:
8590

8691
{{< figure src="/attachments/refguide/modeling/pages/page/page-url-dialog.png" alt="page url dialog" class="no-border" >}}
8792

8893
{{% alert color="warning" %}}
89-
Page URLs are not supported for pages that have non-persistable entities as parameters
94+
Page URLs are not supported for pages that have non-persistable entities as parameters, or have optional parameters.
9095
{{%/alert %}}
9196

9297
In simple e-commerce applications, the URLs can be configured as follows:

0 commit comments

Comments
 (0)