Add to the API Call's URLCustomize the CSSExpandable/Collapsible Subject MenuAdd Stripes to Rows
This is the "Multiple API Calls (Same Type)" page of the "Widgets & API Utility in LibGuides & LibGuides CMS (v1)" guide.
Alternate Page for Screenreader Users
Skip to Page Navigation
Skip to Page Content

Widgets & API Utility in LibGuides & LibGuides CMS (v1)  

Learn more about widgets and API calls available in LibGuides & LibGuides CMS.
Last Updated: Mar 21, 2015 URL: http://help.springshare.com/guidewidgets Print Guide RSS UpdatesEmail Alerts

Multiple API Calls (Same Type) Print Page
  Search: 
 
 

Adding Multiple Calls for the Same API Type to One Page

You can include multiple LibGuides API calls on one page, but you need to change a couple of things:

  • update the id in the div (at the beginning of the Javascript code), and
  • add a parameter to each JavaScript querystring.

Adjusting the div basically means changing the id='api_search_category_iid1' (where 1 is your iid) to something a little different, like api_search_category_iid1a.

Each ID must be unique, so adding the a (or b, c, d, etc.) at the end is an easy way to make it unique.

Then add the parameter to the end of the querystring. You'll need to use the same id you used in the div at the end of this: &id_override=modified div id here.

Here's an example using subjects from the SpringyLib LibGuides site (changes are in bold):

This is the first API call added to the page:

<div id='api_search_category_iid1714'></div><script type='text/javascript' src='http://api.libguides.com/api_search.php?iid=1714&type=category&search=Art&more=false&context=object&format=js'> </script>

This is the second:

<div id='api_search_category_iid1714a'></div><script type='text/javascript' src='http://api.libguides.com/api_search.php?iid=1714&type=category&search=science&more=false&context=object
&format=js&id_override=api_search_category_iid1714a'> </script>

This is the third:

<div id='api_search_category_iid1714b'></div><script type='text/javascript' src='http://api.libguides.com/api_search.php?iid=1714&type=category&search=local+interest&more=false&context=object
&format=js&id_override=api_search_category_iid1714b'> </script>

And you'd keep going from there!

 

Example:

Here they are in action:

The first call:

The second call:

The third call:

Description

Loading  Loading...

Tip