@@ -9,21 +9,39 @@ Each widget integration requires your PERSCOM ID and the use of an API key with
99PERSCOM ID can be found under the general settings of your Dashboard.
1010:::
1111
12+ ## Choosing The Widget
13+
14+ Each widget uses the same HTML code snippet to display the data. However, to set which widget you would like outputted, you must set the
15+ ` data-widget ` attribute to the intended widget. The available options are listed below.
16+
17+ ``` html
18+ <div id =" perscom_widget_wrapper" >
19+ <script
20+ id =" perscom_widget"
21+ data-perscomid =" PERSCOMID"
22+ data-apikey =" APIKEY"
23+ data-widget =" roster" // [!code focus]
24+ src =" https://widget.perscom.io/widget.js"
25+ type =" text/javascript"
26+ ></script >
27+ </div >
28+ ```
29+
1230## Available Widgets
1331
1432The following widgets are currently available.
1533
16- 1 . [ Roster] ( /external-integration/widgets/roster )
17- 2 . [ Awards] ( /external-integration/widgets/awards )
18- 3 . [ Ranks] ( /external-integration/widgets/ranks )
34+ 1 . [ Roster] ( /external-integration/widgets/roster ) ` data-widget='roster' `
35+ 2 . [ Awards] ( /external-integration/widgets/awards ) ` data-widget='awards' `
36+ 3 . [ Ranks] ( /external-integration/widgets/ranks ) ` data-widget='ranks' `
1937
2038## Authentication and Authorization
2139
2240Each widget requires the creation of an API key with the ` access:widget ` scope assigned. Generating API keys is a simple process that can be
2341accomplished in your Dashboard. Creation and management of API keys require the ` manage:api ` permission. Contact your account administrator
2442if you cannot access the API section within your Dashboard.
2543
26- Second, each widget requires your PERSCOM ID which can be found in the General Settings area of your Dashboard.
44+ Second, each widget requires your PERSCOM ID which can be found in the general settings area of your Dashboard.
2745
2846These two items will be inserted into the widget when you add them to your website. Failure to add these values with result in an
2947authentication error when viewing the widget.
@@ -32,27 +50,47 @@ Click [here](/external-integration/api) for more documentation on the API.
3250
3351## Customization
3452
35- Each widget may be customized using CSS by using the uniquely named DOM elements that comprise each widget. To get started, inspect the
36- widget in your preferred browser so that you can see the HTML. Identify the element you would like to customize and make note of the ` id `
37- attribute. Using the HTML ` <style> ` tag, add your custom CSS above the widget HTML. You can view the example below for further explanation.
53+ The widgets are embedded within an ` iframe ` HTML element that prevents the host website from overriding and altering the styling of the
54+ widget. While this may seem like a disadvantage, it helps prevent the unwanted style changes to the widget that can happen by the hosting
55+ website. However, the widget is wrapped in a parent div that may be customized to alter how the ` iframe ` is embedded within your website.
56+ See the example below on how to customize the ` perscom_widget_wrapper ` .
3857
3958### Example
4059
41- In the following example, we are going to center each table column header within the roster widget. The ` id ` of the ` <th> ` element that we
42- are going to customize is ` perscom_widget_table_header_column ` . Making note of this, we have inserted the custom CSS above the widget .
60+ In the following example, we are going to adjust the height of the parent div to fit the widget appropriately . The CSS is added just above
61+ the code snippet for it to take affect .
4362
4463``` html
4564<style >
46- #perscom_widget_table_header_column {
47- text-align : center ;
65+ #perscom_widget_wrapper {
66+ height : 500 px ;
4867 }
4968 </style >
5069
51- <div id =" perscom_roster" data-apikey =" APIKEY" data-perscomid =" PERSCOMID" ></div >
52- <link href =" https://widget.perscom.io/widget.css" rel =" stylesheet" />
53- <script src =" https://widget.perscom.io/widget.js" ></script >
70+ <div id =" perscom_widget_wrapper" >
71+ <script
72+ id =" perscom_widget"
73+ data-perscomid =" PERSCOMID"
74+ data-apikey =" APIKEY"
75+ data-widget =" roster"
76+ src =" https://widget.perscom.io/widget.js"
77+ type =" text/javascript"
78+ ></script >
79+ </div >
5480```
5581
82+ ## Externally Accessing The Widget
83+
84+ The PERSCOM.io widget can be accessed outside of the HTML code snippet that you used to post within your website. To see your widget live,
85+ without embedding it in a website, you can visit the URL's below. Make sure to set APIKEY and PERSCOMID to the correct values.
86+
87+ Roster:
88+ [ https://widget.perscom.io/roster?apikey=APIKEY&perscomid=PERSCOMID ] ( https://widget.perscom.io/roster?apikey=APIKEY&perscomid=PERSCOMID )
89+ Awards:
90+ [ https://widget.perscom.io/awards?apikey=APIKEY&perscomid=PERSCOMID ] ( https://widget.perscom.io/awards?apikey=APIKEY&perscomid=PERSCOMID )
91+ Ranks:
92+ [ https://widget.perscom.io/ranks?apikey=APIKEY&perscomid=PERSCOMID ] ( https://widget.perscom.io/ranks?apikey=APIKEY&perscomid=PERSCOMID )
93+
5694## Development
5795
5896The PERSCOM.io Widget project is ** open source** and actively looking for developers to participate. If you have experience with frontend
0 commit comments