Getting started
...
Create an app from scratch
Combine the solution's element...

Add the solution stories jig and datasource

5min

Overview

In this step, you will learn how to create a dedicated area on the

 for content, such as news, announcements, videos, URLs, or images. The area is added using stories. You will create the story file using the component.story-group and a static datasource to reference two images with a title.

Steps

Create a datasource file for the story jig

  1. You need to add the data that the solution story
    
    can read from. For this step, you create a Static Datasource in the datasource folder of the project. The data specifies the description, title, and image for the story. Right-click on the datasources node in Explorer and select New file.
  2. Name the file story-static. The file opens and shows the
    
    's auto-complete popup listing the datasource types. Click on Static datasource to open the skeleton YAML created by the
    
    .
  3. You will add an image, titles, thumbnails, and descriptions as the data for displaying the story jig.
  4. See the sample datasource code below for adding the image details for the story jig to display. Save the project.
story-static.jigx


Create a story to a jig

  1. Open the Hello-
    
    solution in the
    
    in
    
    , right-click on the
    
    s node in Explorer, and select New file.
  2. Name the file solution-story. The file opens and shows the
    
    's auto-complete popup listing the five
    
    types. Click on Default to open the skeleton YAML created by the
    
    
  3. Give the
    
    a title called My customer story and provide a description like Customer story.
  4. For this jig you can delete the header , onFocus, and datasource lines.
  5. For the container to display the story add an entity component with an entity field as shown in the code below:
YAML


6. Now you can add the story that will be displayed in the dedicated area at the top of the

. Under the children node type stories:, the auto selection pops up, select stories to open the skeleton YAML . Under data add an expression to reference the data from the story-static.jigx datasource file. Add data: [email protected]. You can add a groupName: that displays on the story. You can add your own or use My work day.

7. Under Item: you need to define the item type, in this solution, add the component: image type as the datasource is an image. Add the title field by adding the following expression to reference the title from the datasource file title: [email protected]. Add a subtitle: [email protected]. Add the source of the image by using an expression source: uri: [email protected]. Lastly, add the following to open a web site when the story is pressed. onPress: type: action.open-url options: title: Read More url: https://docs.jigx.com/stories

8. Your stories node should resemble the code below. Save the project.

YAML


9. Your solution-story.jigx file should resemble the code below.

solution-story.jigx