Technical documentation of the Documents Link widget
Description
This page contains the technical documentation of the Documents Link widget. With the integration, a parameter, e.g. the factory article number, can be searched for in the library in order to map the relevant individual page with the parameter found. In this way, relevant pages can be automatically output for the corresponding article. The contents of this page are listed below:
Contents
Integration via “xs-loader” widget
All widgets are integrated via the “xs-loader”.
Parameter “xs-documents-link”
This widget starts a search with the passed parameters and displays the hits in sales documents as single pages. Only PDF documents are taken into account.
Input | ||||
---|---|---|---|---|
Main parameter | Sub-parameter | Mandatory | Description | Example value |
filter |
| Yes | Die Grundlage des Widgets. Hier wird festgelegt welche Dokumente angezeigt werden sollen.
|
|
| searchterms | Yes, if documents is not set | The parameters consist of parameters that accept an array of strings to display multiple suppliers, for example
and parameters that take a single value
All parameters can be combined as desired to display the desired result. |
"filter": {
"searchterms": {
"supplierids": ["adminlfr1"],
"infopackagenames": ["Suchtest"],
"documentcountries": ["de"],
"documentlanguages": ["de"],
"tags": ["Querformat"],
"archived": false,
"documentcount": 25,
"language": "de"
}
} |
| documents | Yes, if parameters is not set | A combination of document ID and page of the document to be used as a thumbnail. IMPORTANT: The document links only work if the external link is created and active The parameter consists of:
|
"filter": {
"documents":[
{
"id": "99678681-c7fa-4184-83aa-d9694e9ef790",
"thumbnailpage": 4
},
{
"id": "76d38ef0-bdcb-4237-bb2c-ff85d073db46",
"thumbnailpage": 2
}
]
} |
pdfviewer |
| No | Object with configurations for the PDF viewer |
|
| position | No | Specifies the position of the PDF viewer. The viewer can be moved so that, for example, a header from the background is not covered. The attribute consists of:
All numbers are converted into pixel values and interpreted as such. | "pdfviewer":{
"position":{
"top": "150px",
"right": "20px",
"bottom": "50px",
"left": "20px"
}
} |
showdocumentdescription |
| No | Parameter that specifies whether the document description is displayed below the image. Defaultwert: false | |
showinfopackagename |
| No | Parameter that specifies whether the info package in which the document is located is displayed below the image Defaultwert: false | |
style |
| No | JSON object to define the primary and secondary color of the widget. The object has two fields:
| |
downloadinnewtab |
| No | If the parameter is set to true, a new tab will open when you click on the download button and the file will be downloaded |
|
Ausgang | ||||
Eingangsevents | ||||
closeAlldialogs |
|
| This event can be emitted to the widget. The widget catches the event and then closes all currently open dialog windows. | Example call: |
Example image
A single document with default settings
Multiple documents with default settings
If the parameter “showdocumentdescription” is set to “true”
If the parameters “showdocumentdescription” and “showinfopackagename” are set to “true”
Example parameters
Example integration
Embed the following code snippet into the HTML DOM.
Widget-Loader V1.x.x
Widget-Loader V2.x.x
Example event “status”
The following code example waits for the return event “status” from the Documents widget.
Sample code (PHP)
Widget-Loader V1.x.x
Widget-Loader V2.x.x