Example for widget definition
Ideally, prepare a list of third-party HTML resources, you want to set up as widgets, including stylesheets and scripts.
In Builder, navigate to default/storefront/assets. Via 'Actions', create a new file
![Click on 'Create File' Click on 'Create File'](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/964db667-fdfc-4372-95ff-5676cb6aebc6/f922b2e0-98ee-4f44-addc-6f777f14b0d4.png?crop=focalpoint&fit=crop&fp-x=0.0745&fp-y=0.3037&fp-z=2.3218&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=25&mark-y=365&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz0zNjQmaD04MCZmaXQ9Y3JvcCZjb3JuZXItcmFkaXVzPTEw)
Create a "generic-widget.json", and once its created add the initial array to the file, with adding "[]"
![Click on 'Create generic-widget.json' Click on 'Create generic-widget.json'](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/99a19e16-2a76-4ebc-ab54-f03f5b36fee2/4738840f-7da6-4823-b578-325f5a87a446.png?crop=focalpoint&fit=crop&fp-x=0.5000&fp-y=0.5557&fp-z=1.5113&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=272&mark-y=379&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz02NTYmaD01MiZmaXQ9Y3JvcCZjb3JuZXItcmFkaXVzPTEw)
Close and re-open the Editor. It now should look like this:
![Click on the plus symbol Click on the plus symbol](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/3a80ca56-bb70-438c-b988-727969946c39/83ad5bf8-43b5-4db7-ba78-7343b5a58cad.png?crop=focalpoint&fit=crop&fp-x=0.3829&fp-y=0.2595&fp-z=1.9393&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=469&mark-y=178&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz01NyZoPTY0JmZpdD1jcm9wJmNvcm5lci1yYWRpdXM9MTA%3D)
Next to 'name' type the Widget Library name. You may use this to structure multiple widgets of different distributors. We use 'demo' as an example:
![Next to 'name' type the Widget Library name Next to 'name' type the Widget Library name](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/ff7c54ae-6a8f-4673-ba38-adcc715df00e/5bc4b301-5434-48df-b870-c336b8711bbf.png?crop=focalpoint&fit=crop&fp-x=0.5938&fp-y=0.2171&fp-z=1.7203&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=238&mark-y=268&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz03MjMmaD02OSZmaXQ9Y3JvcCZjb3JuZXItcmFkaXVzPTEw)
To now add widgets to the library. Demo Library, click on the Properties icon
![Demo Library, click on the Properties icon Demo Library, click on the Properties icon](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/b90502d9-fcb6-44d5-b9cc-46526b726a46/1a11bd69-ba08-47fb-bdf9-cc8086265c76.png?crop=focalpoint&fit=crop&fp-x=0.5120&fp-y=0.3299&fp-z=1.9393&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=1071&mark-y=276&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz02MCZoPTY0JmZpdD1jcm9wJmNvcm5lci1yYWRpdXM9MTA%3D)
10. Name your Widget and confirm via clicking the Plus icon.
![type the name of the first widget then click on the Plus icon type the name of the first widget then click on the Plus icon](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/8b390151-df3d-4a51-8725-2e77743549da/4ab2f6da-47c6-4ecc-b314-64947b261d1c.png?crop=focalpoint&fit=crop&fp-x=0.5551&fp-y=0.3915&fp-z=1.9393&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=974&mark-y=253&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz01NyZoPTY0JmZpdD1jcm9wJmNvcm5lci1yYWRpdXM9MTA%3D)
11. Next to 'html' insert or type the HTML of the widget. We used "<div id="demo-widget-1" class=“demo-widget">" as an example
![Next to 'html' insert or type the HTML of the widget. Next to 'html' insert or type the HTML of the widget.](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/94c8f9bf-dbf2-43bf-8632-e4977258b1ea/f5bf7a0b-d386-41c3-ad36-67e8dbbf85a2.png?crop=focalpoint&fit=crop&fp-x=0.5916&fp-y=0.3352&fp-z=1.7069&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=237&mark-y=371&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz03MjcmaD02OCZmaXQ9Y3JvcCZjb3JuZXItcmFkaXVzPTEw)
12. Below 'resources' click on the plus icon.
![Below 'resources' click on the plus icon Below 'resources' click on the plus icon](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/a04ed75e-be09-4f72-a7b8-355f7f48cf56/c32e1b82-30b8-46ad-bdd4-5d5cee44c729.png?crop=focalpoint&fit=crop&fp-x=0.4380&fp-y=0.4306&fp-z=1.9393&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=514&mark-y=330&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz01NyZoPTY0JmZpdD1jcm9wJmNvcm5lci1yYWRpdXM9MTA%3D)
13. Click on the properties icon
![Click on the properties icon Click on the properties icon](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/ba8587ef-2b3c-446e-beaa-867d0ef70e08/faafad4f-bd1e-470c-8ffd-aadf84f778aa.png?crop=focalpoint&fit=crop&fp-x=0.6268&fp-y=0.4384&fp-z=1.9393&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=673&mark-y=335&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz02MCZoPTY0JmZpdD1jcm9wJmNvcm5lci1yYWRpdXM9MTA%3D)
14. Check the boxes next to all your needed resources. When done, click on the properties icon again.
![Check the boxes next to all your needed resources. Check the boxes next to all your needed resources.](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/ffbf1a64-2012-4eb8-876f-167fb32a2a88/689065c5-d7cc-49c7-8157-154ee9413960.png?crop=focalpoint&fit=crop&fp-x=0.5666&fp-y=0.4815&fp-z=2.0000&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=819&mark-y=263&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz02MiZoPTY2JmZpdD1jcm9wJmNvcm5lci1yYWRpdXM9MTA%3D)
15. Next to 'URL' type the URL of the resource. We used "https://demo.min.js" as an example
![Next to 'URL' type the URL of the resource. Next to 'URL' type the URL of the resource.](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/ee8b2336-18dc-4d73-9a79-fd390b100868/9a17a1ac-7e92-4704-8f8f-2d88f3ec4727.png?crop=focalpoint&fit=crop&fp-x=0.6204&fp-y=0.5332&fp-z=1.9156&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=272&mark-y=367&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz02NTUmaD03NyZmaXQ9Y3JvcCZjb3JuZXItcmFkaXVzPTEw)
16. Next to 'placement', choose whether to put your widget in the head or the body
![choose whether to put your widget in the head or the body choose whether to put your widget in the head or the body](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/b806e1fd-3dbf-4656-8b98-5bd9d8c69b4d/70843791-c973-4673-b57d-5aef252cbb04.png?crop=focalpoint&fit=crop&fp-x=0.6429&fp-y=0.5827&fp-z=2.0955&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=298&mark-y=363&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz02MDQmaD04NCZmaXQ9Y3JvcCZjb3JuZXItcmFkaXVzPTEw)
17. Next to position, select the position of the resource
![select the position of the resource select the position of the resource](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/bcf3ee45-3b41-4c1b-a5c2-bcd16cbfc72a/78e36821-93c0-437c-8e06-d323640d2645.png?crop=focalpoint&fit=crop&fp-x=0.6364&fp-y=0.6322&fp-z=2.0403&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=290&mark-y=364&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz02MjAmaD04MiZmaXQ9Y3JvcCZjb3JuZXItcmFkaXVzPTEw)
18. Next to 'properties', click on the properties icons
![click on the properties icons click on the properties icons](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/6da4d588-65bb-401a-a4f7-595aa4cac377/affd5dc7-7933-4c16-9db7-496389560f0a.png?crop=focalpoint&fit=crop&fp-x=0.6638&fp-y=0.6331&fp-z=1.9393&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=703&mark-y=445&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz02MCZoPTY0JmZpdD1jcm9wJmNvcm5lci1yYWRpdXM9MTA%3D)
We added here only an empty async.
![Add the script of your property and click on the plus symbol Add the script of your property and click on the plus symbol](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/17dbac22-4fc3-4c00-9367-fb1de29aa7f3/c42cb663-3975-438e-ba7c-230d053b4cb1.png?crop=focalpoint&fit=crop&fp-x=0.6645&fp-y=0.6677&fp-z=1.9393&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=705&mark-y=464&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz01NyZoPTY0JmZpdD1jcm9wJmNvcm5lci1yYWRpdXM9MTA%3D)
20. On the bottom of the Resources section, click on the plus symbol to add the Global resources.
Repeat steps from 13- 17 to create global resources.
![click on the plus symbol click on the plus symbol](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/a03e5558-4a7f-4f6b-8ab0-e110ec1c3472/cc2b0a44-8ab9-4ca7-b1d6-bbf244f7934b.png?crop=focalpoint&fit=crop&fp-x=0.3982&fp-y=0.8268&fp-z=3.0834&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=555&mark-y=355&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz05MCZoPTEwMSZmaXQ9Y3JvcCZjb3JuZXItcmFkaXVzPTEw)
21. You can add another widget library by clicking on the plus symbol
![add another widget library by clicking on the plus symbol add another widget library by clicking on the plus symbol](https://images.tango.us/workflows/51eee32a-25c0-429a-9ee4-c907120b70e9/steps/e05954ff-ffa8-4d08-b45a-b0af6caf48fe/67a65d63-16f3-4f65-8f04-b76a77822b1d.png?crop=focalpoint&fit=crop&fp-x=0.3389&fp-y=0.1350&fp-z=2.9369&w=1200&border=2%2CF4F2F7&border-radius=8%2C8%2C8%2C8&border-radius-inner=8%2C8%2C8%2C8&mark-x=557&mark-y=273&m64=aHR0cHM6Ly9pbWFnZXMudGFuZ28udXMvc3RhdGljL2JsYW5rLnBuZz9tYXNrPWNvcm5lcnMmYm9yZGVyPTYlMkNGRjc0NDImdz04NiZoPTk2JmZpdD1jcm9wJmNvcm5lci1yYWRpdXM9MTA%3D)
22. After configuring your first generic widget, you need to tell the application about it's existence. To do that, open your urls.json, which is located in same folder. You can add the GenericWidget property simply by clicking the Property-Button on the top right of the urls.json pane.
![Document image Document image](https://images.archbee.com/ygR6KtT9QI_R0u3uKTJsm/dcxAUNEItB7-9xHjnmaZ9_bildschirmfoto-2023-09-14-um-183846.png?format=webp)
23. Now add the path accordingly.
![Document image Document image](https://images.archbee.com/ygR6KtT9QI_R0u3uKTJsm/MEcA5AZ-dntM4DuflqqpP_bildschirmfoto-2023-09-14-um-183248.png?format=webp)
This is a widget from 'weekli' to be integrated. It contains an html div tag with a script. The script should be loaded after the html div tag.
The configuration within the "generic-widget.json" should resemble:
![Document image Document image](https://images.archbee.com/ygR6KtT9QI_R0u3uKTJsm/sU9Iia6f8JvH_NoNM7zpX_image.png?format=webp)