Introduction
Narratives are of course meant to be made highly dynamic, however, before making your Narrative dynamic, it is highly recommended to do a static Narrative first and to test that it works and is rendered visually correctly in your front-end.
...
Info |
---|
We recommend you to keep a static narrative copy, so you can easily make modifications in the future, without being limited by having to work with a more complex dynamically configured narrative. You can do that by having your static narrative connected to another widget you use only for testing or by connecting to the same widget, but adding a context (for example: checking the value of a request parameter) so that the static narrative is used when this parameter is set in your API request. |
Step 1: Create your Narrative WPO Widget
Every Narrative is connected to a WPO widget. This way, when you make your call to the Boxalino Narrative API you can indicate the widget you would like to retrieve your Narrative from.
You can create a widget without any special strategy simply by following the guide : How to add a new WPO Widget
Info |
---|
As you will create a widget for a Narrative, make sure to select one of the 3rd line WPO : PRESENT, TELL OR PERSUADE as described in the How the above How to link. |
Step 2: Configure your Narrative with a Fix Layout
Now that you have created your widget, you can create your Narrative:
First, go to the Marketing > Narrative menu and click on the top-left button “+ Add” to add a narrative.
Give a name to your narrative (all small caps, no special characters except _ ).
Then click on the pencil to edit it and do the following:
Define a Title in every language (optional, not needed if the Narrative doesn’t affect the page title)
Define other SEO content in the SEO Tab (optional, not needed if the Narrative doesn’t affect those)
Add a Fix Layout with the “+ Add” button.
...
After adding a Fix Layout, you need to add each Layout Block in the order you want. following the example, the first is title:
...
to the last which is product slider:
...
For each of the element in the list, you need to provide some sample (dummy) values of each parameters, like here for the title:
...
And for the case of the product slider (which is the same for any block which has the property “bx-hits” and is a container of products (see https://boxalino.atlassian.net/wiki/spaces/BPKB/pages/edit-v2/26509390 for details), there need to be one Sub-Content Element with the Layout Block “product”:
...
Info |
---|
You typically don’t have to define any parameter for the product you add as a sub-content Layout Block. The Boxalino Narrative API will automatically duplicate this element for the number of hits returned (which depends on the hitCount you request in your Narrative API request) with the results of the widget you selected. |
Step 3: Deploy your Narrative in Test (or publish it)
Now that you have configured your static Narrative, you can deploy it in test mode with the button “Test” on the top right:
...
Please refer to the logic defined in Sep 3 : Publish Your Configuration of How to add a new TPO WidgetWPO Widget to decide if you need to publish your account (and if needed to do it).