Including the widget on your site is easy. The only requirement is an API-Key which you can get from your Giving Compass contact.
If you're new to Giving Compass software solutions, please contact us to learn more.
The following examples demonstrate variations on how this widget may look against different layouts of an imaginary company website.
You can display the widget embedded on a page by adding the Vue component.
Start by including the widget script:
<script src="https://firstname.lastname@example.org/dist/vue.min.js"></script> <script src="https://code.givingcompass.org/gc-wc-articles/1.1.0/gc-wc-articles.min.js"></script> <link href="https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Roboto:wght@400;500&display=swap" rel="stylesheet">
Then place the following code on your site where you want the widget to display:
Additional attributes can be added to customize the look of the widget.
<gc-wc-articles api-key="MY_API_KEY" per-page="10" render-list-as="list" width="300px"></gc-wc-articles>
The following attributes can be added to the component code to add further customization.
Partner API key that can be obtained from your Giving Compass contact.
Override the widget heading to better suit your page.
Default: Philanthropy Knowledge Hub
Recommended character length: 24
Override the widget introductory text to better suit your page.
Display options for the list of articles.
Number of articles to display per page.
Forces the widget to a specific width regardless of the user's browser width.
Prevents the widget from expanding past a width while behaving responsively below it.
Include specific search terms with the results list.
Excludes specific search terms from the results list.
Only return results for specific categories.
Excludes specific categories from the results list.
Only return results for specific tags.
Excludes specific tags from the results list.
|*By default the widget is responsive with a minimum width of 200px and will resize based on the containing wrapper it is placed in. By setting the width or max-width this behavior is overridden.|
The widget will render as a tile or link unless explicitly changed. If you would like to switch to a link list for certain views, then change the render-list-as attribute when your code detects the view criteria. Remember to change the value back in the reverse case.