- Get Started
- Functionality
- Learning
- Extension
- Dev Tooling
- APIs
- Releases
Authors:
Cameron Johns, Cille Schliebitz, Anita Gu
Changed on:
3 Feb 2025
`activeLocation` context to configure a page query as a data source for the List Component.`dateStringFormatter`), array access, attribute retrieval by name, and image rendering.`fc.mystique.manifest.store`If you do not have this setting or you would like to update it, download the main store manifest.The Fluent Store URL: `https://[ACCOUNTID].sandbox.apps.fluentcommerce.com/store/`Note: Replace "`[ACCOUNTID]`" with your assigned Training Account, e.g.: `FCTRAINAU001`Log in to the Store app using the F_SYD Location User:`F_syd@fcfashion.com.au``1234``data` object on the Page Route takes a `query` and a `variables` object to define a GraphQL Query.You'll notice the use of a special variable called `{{activeLocation.ref}}` above. Since this Web App Context is "location", you can access the currently active context using the `activeLocation` object. This provides access to the Location Id, Ref, and Primary Address.Once the Page query is defined, go to the Component configuration and add a `dataSource` field. The `dataSource` for the list should be set to the `storageAreas` connection on the `location` query path: `location.storageAreas` `"dataSource": "location.storageAreas"`With the data source configured, all that's left is to update the fields to be displayed in the list with dynamic values. We'll display the Name, Type, and Status from the Storage Area.This is done by specifying the field of each node in the Storage Areas connection: `{{node.name}}` See this in action in the video below...Learn more about configuring the page query and dynamic attributes in the UX Framework Configuration Guide.`storageAreaById` query and retrieve the connection to the associated articles.Watch below to see this in action...Now that we have our Storage Area Summary information and have set it to half-screen width, let's add a list to display the associated Articles.`dateStringFormatter` to help format the raw date values in more readable forms.Take a look at the following video to see this in action.For more information on helper functions available to the dynamic values, read about Template Strings in UX Configuration Common Concepts.There are also some useful features for working with arrays. Typically, you can access an array item by its index as follows: `node.attributes.0.value`This works on edges too: `node.articles.edges.0.node.ref`Now, you can retrieve Attributes by Name: `node.attributes.byName.Size`In our example, the Article associated with the Storage Area contains an attribute named "FulfilmentType". See how we can show this in the Articles list below.You can render images in lists and cards by specifying the component attribute type as "image." This also allows you to provide additional options to the generated image HTML.Read more about configuring Dynamic Attributes in UX Configuration Common Concepts.1"data": {
2
3"query": "query locationStorageAreas ($locationRef: String!) { location (ref: $locationRef) { id ref storageAreas { edges { node { id name status type } } } } }",
4
5"variables": {
6
7"locationRef": "{{activeLocation.ref}}"
8
9}
10
11}1"attributes": [
2
3{
4
5"label": "Name",
6 "value": "{{node.name}}"
7
8},
9
10{
11
12"label": "Type",
13 "value": "{{node.type}}"
14
15},
16
17{
18
19"label": "Status",
20 "value": "{{node.status}}"
21
22}
23
24]1{
2 "type" : "image",
3 "value" : "{{attributes.byName.imageUrl}}",
4 "options" : {
5 "width" : 220
6 }
7 }