...
In addition, the product listing (the same one) must have in its content an “injection” parameter which provides a JSON string configuration for the injection.
...
Info |
---|
In order to set the orange value, put string {{template-injection_listing}} if you don’t have the dynamic expression feature active. |
Tip |
---|
For your testing, you can also simply copy & paste a minified json of your configuration in the injection field, so you don’t have to configure the injection in BigQuery by yourself. |
As here, it is typical that the JSON will not be put as a static string in the injection parameter, but instead will be loaded by Boxalino from Google BigQuery. This will be done with a template resource that Boxalino can configure for you.
...
Parameter | Description | Example value | |
---|---|---|---|
type | configuration model type (currently only ‘standard’) | standard | |
version | configuration version (currently only 1) | 1 | |
sub_version | configuration sub version (currently only 1) | 1 | |
layout | constraints about your layout (e.g.: how many cols per device) | ||
layout[*].name | key for the layout case (e.g.: for the device) | ua-deviceCategory | |
layout[*].value | value for the layout case (e.g: for mobile) | Smartphone/Desktop | |
layout[*].cols | number of columns per row in this device (e.g.: 2 for mobile, 4 for desktop) | 2 | |
injection | information about the injections to be made | ||
injection.minimum | minimum number of injections (an injection has the number of element defined in the size) | 1 | |
injection.maximum | maximum number of injections (an injection has the number of element defined in the size) | 1 | |
injection.size | size of an injections (here 4 elements, which means 1 row for the desktop and 2 rows for the mobile in case of example layout[*].cols above) | 4 | |
positions | information about which positions should be filled in the listing | ||
positions[*].id | unique string identifier of the position | 1 | |
positions[*].positions | list of specific positions (which can be different per device for instance) | ||
positions[*].positions[*].position | index where the content should be injected | 2 | |
positions[*].positions[*].cols | size of the content in columns | 1 | |
positions[*].positions[*].rows | size of the content in rows | 1 | |
positions[*].positions[*].type | type of position (currently only fixed) | fixed | |
positions[*].positions[*].parameters | additional parameters (optional) | format: array<struct<name string, array<string>>> | |
positions[*].positions[*].segments | segments on which this position applies | [{"name": "ua-deviceCategory" | |
positions[*].parameters | additional parameters (optional) | format: array<struct<name string, array<string>>> | |
positions[*].conditions | advanced conditional logic | see section Advanced Conditions below | |
content | the content | the content which should be injected | |
content[*].selector_type | selector type to indicate how to recognize which of the content container should be detected (by default detection done by block parameter) | parameter | |
content[*].selector_name | indicate on which parameter name the content selector should apply (typically selector is done on a template parameter) | template | |
content[*].selector_value | indicate on which parameter value the content selector should apply (so here we indicate that the selector should take the bloc container template) | blog-container | |
content[*].type | type of content (so far always container) | container | |
content[*].position_ids | list of unique position identifiers to be filled with this content source (must match identifiers defined in positions[*].id) | ['1','2'] | |
content[*].page_offsets | indicate how much offset should be applied per page (if -1, content is only injected in the first page) | -1 | |
content[*].conditions | advanced conditional logic | see section Advanced Conditions below | |
content[*].parameters | additional parameters (optional) | format: array<struct<name string, array<string>>> |
...
How to configure the Dynamic Expression & Template Resource
The Dynamic Expression of the product listing Block of the narrative can be configured as a Script → Template Resource variable as here:
Info |
---|
This section is to configure the injection from BigQuery, for your test, we recommend to put the json as a minified configuration manually in the injection parameter (instead of writing {{template-injection_listing}} which will be simpler to manage. |
The Dynamic Expression of the product listing Block of the narrative can be configured as a Script → Template Resource variable as here:
...
The Template Resource should be defined before (here injection_listing) and should come (typically) from a Real-Time Correlation, here are the typical parameters (in Menu : Advanced > Template Resources).
...
The values to indicate for the Values, type and valuesKey should be confirmed by Boxalino as they depend on the data which is loaded from Google BigQuery, but the values indicated here are the default values and can typically be used.
Injecting Facets
The prior sections indicate how to inject content, but it might also be interesting to inject facets.
In this case, you can reuse the same facet container Layout Block you use for your search and navigation filters, but you need to add one new Facet Layout Block, here is an example:
...
Then you can set the facet container and new facet Layout containers in your narrative as children of the list container after the product block as you would do for content injection, here is an example:
...
Finally, you might wnt to add parameters to your facet (for example to have a different label per facet with a question) as follows:
...
If you follow this pattern to put your main language as a parameter (e.g.: “question”) and sublanguages with _LAN then the system will return the current language automatically in the facet parameters on the main name (so a request in French would here return the facet parameter as “question”: “Quelle couleur…” in case your request language was ‘fr’).
The API response will return in the injected facet block a “bx-facet” parameter with the same structure as the bx-facets you already use for the filters on the left, but only with 1 facet (instead of all of them).
The values which are to be shown to the user has the parameter “show”: true (you can ignore the other ones).
Code Block |
---|
{ "bx-facet": { "field": "brand", "values": [ { "value": "First brand", "hitCount": 18, "show": true, "order": 0 } ... |
Advanced Conditions
Listing Conditions can also support advanced real-time conditions (as part of the “content” field) to implement custom behaviors in the listing injections.
...