In cards we can link to other dashboard pages and dynamically update the context of the linked page through the “href” property of the Text component.
Basic HREF Link
The href can be linked simply to a page through the page route. Navigate to the application, and in the screens tab copy the route of the desired page. Surround that simple route with a forward slash on either side, and put this into the Text’s href property.
For example, the href would be the below if the page route is “profit-and-loss”:
Dynamic HREF Link
The href can be linked in a more dynamic way through the property editor in order to update the context of the destination page based on the current card. Click on the calculator in the href property to open the property editor.
The page route is still required for a dynamic route, so include the page route wrapped in forward slashes and double quotes. It would then be followed by a question mark, which marks querying into the detail of the context- adding dimensions as parameters into the browser URL.
At this point the href will appear as below:
To finish the portion in double quotes, add an “=”. This will determine what the identified dimension should be set to.
The href will appear as below once the ID is taken (using above example ID):
Dynamic HREF Link - Multiple Dimensions
The above is able to be done for multiple dimensions at once, by concatenating with an ampersand (&) within the quoted portions. A href referencing multiple dimensions may appear like below:
Basic HREF Link
The href can be linked simply to a page through the page route. Navigate to the application, and in the screens tab copy the route of the desired page. Surround that simple route with a forward slash on either side, and put this into the Text’s href property.
For example, the href would be the below if the page route is “profit-and-loss”:
- /profit-and-loss/
Dynamic HREF Link
The href can be linked in a more dynamic way through the property editor in order to update the context of the destination page based on the current card. Click on the calculator in the href property to open the property editor.
The page route is still required for a dynamic route, so include the page route wrapped in forward slashes and double quotes. It would then be followed by a question mark, which marks querying into the detail of the context- adding dimensions as parameters into the browser URL.
At this point the href will appear as below:
- “/page-name/?”
- https://go.modlr.co/model/example/12342a2k4j58386573fbh5/dimension/61dabb43725cb7bc4383ec2d4f9884bf
To finish the portion in double quotes, add an “=”. This will determine what the identified dimension should be set to.
The href will appear as below once the ID is taken (using above example ID):
- “/page-name/?61dabb43725cb7bc4383ec2d4f9884bf=”
- “/page-name/?61dabb43725cb7bc4383ec2d4f9884bf=”&URLENCODE(ELEMENT(”Dimension Name”))
Dynamic HREF Link - Multiple Dimensions
The above is able to be done for multiple dimensions at once, by concatenating with an ampersand (&) within the quoted portions. A href referencing multiple dimensions may appear like below:
- “/page-name/?dimensionID=”&URLENCODE(ELEMENT(”Dimension Name”))&”&dimensionID2=”&URLENCODE(ELEMENT(”Dimension Name 2”))