PlumX Widgets

Embeddable widgets make it easy to syndicate your artifact-level metrics to your own website, by just adding a few lines of code.

In order to embed the widgets in a page, two pieces of code will have to be added:

  • the widget script tag
  • one or more widget placeholders

Script

The best place for the script tag is at the bottom of your page, right before the closing </body> tag. This will make sure the website will be loaded in its entirety before loading the widget, prioritizing the website content over the widget. Some CMS systems do not allow you to add scripts to the bottom of your page. In that case, you can add the script tag to the <head> element of your page.

Placeholder

The placeholder should be inserted at the desired location of the widget. After the widget script is loaded, it will find all the placeholders, and replace those with a widget based on the configuration attributes specified on the placeholder.

In order to display the metrics, the widget scripts parse the artifact identifier information out of the href attribute of the placeholder. This attribute is composed of the following elements:

  • The PlumX endpoint for your site's artifacts (https://plu.mx/plum/a/?)
  • The artifact identifier (ex: doi=10.1371/journal.pone.0056506)

The artifact identifier is comprised of two parts:

  • the identifier type
  • the identifier value

In short, the templated url looks something like this: https://plu.mx/plum/a/?{id_type}={id_value}
Where the {id_type} and {id_value} need to be replaced with the identifier type and value respectively.

Supported Identifier Types

Currently, we support the following identifier types:

  • doi
  • isbn
  • bepress_url_id
  • arxiv
  • github_repo_id
  • oclc
  • nct_id
  • pmid
  • slideshare_slideshow_id
  • sourceforge_repo_id
  • ssrn_id
  • us_patent_publication_id
  • vimeo_video_id
  • youtube_video_id
  • medwave_id
  • pitt_eprint_dscholar_id
  • smithsonian_pddr_id
  • repo_url
  • cabi_abstract_id
  • ebsco_db_an_match_id
  • elsevier_id
  • scopus_id

Supported Widget Types

We have several types of widgets that you can choose from depending upon how you would like to integrate them into your site. They are Artifact Pop-Up, Artifact Summary, Artifact Details, Artifact PlumPrint, Group, Researcher, and Grant. You can see examples of how to configure them below.

Artifact Pop-Up Widget

The popup widget is a small (~ 130x130px) widget that is well-suited for use in a sidebar.

Script

Placeholder and parameters

attribute values default value description
data-popup top | bottom | left | right | hidden left The direction of the pop-up relative to the widget
data-hide-when-empty true | false true If true, hide the widget when no data is available
data-hide-when-empty true | false true If true, hide the widget when no data is available
data-size tiny | small | medium | large large Controls the size of the plumprint
data-badge true | false false If true, sets data-size to 'small', and appends a link to the artifact page.

Artifact Summary Widget

The summary widget is somewhat bigger than the popup widget, but provides the same level of detail without having to hover. It's well-suited for both a sidebar or the top/bottom of a page.

Script

Placeholder and parameters

attribute values default value description
data-orientation vertical | horizontal vertical The orientation of the widget.
data-hide-print true | false false If true, don't show the PlumPrint
data-hide-when-empty true | false true If true, hide the widget when no data is available

Artifact Details Widget

The details widget is our largest widget. It provides the same level of detail as the artifact page. It is best suited for areas on your site where you have a lot of screen real estate to include it, like on a tab dedicated to metrics, or on a detailed page about the artifact.

Script

Placeholder and parameters

attribute values default value description
data-width any positive integer n/a If specified, the widget will conform to the specified width (any valid css width)
data-border true | false false If true, adds a border around the widget.
data-hide-print true | false false If true, don't show the PlumPrint
data-hide-when-empty true | false true If true, hide the widget when no data is available

Group Widget

Widgets are available at the group level. Groups can be departments, labs, museums, journals, custom collections, and more. All of the metrics for all members of the group and any artifacts associated with them, will be summarized in the group widget. The group is identified by the PlumX identifier. For example, the following code would display the group widget for the National Museum of Natural History from the Smithsonian PlumX site.

Script

Placeholder and parameters

attribute values default value description
data-no-name true | false false If true, hides group name
data-no-description true | false false If true, hides group description
data-no-researchers true | false false If true, hides researchers section
data-no-stats true | false false If true, hides statistics section
data-no-artifacts true | false false If true, hides "recent artifacts" section"
data-num-artifacts 5, 10 or 20 5 Number of artifacts to display
data-width any positive integer 350px If specified, the widget will conform to the specified width (any valid css width)

Researcher Widget

We provide an embeddable widget for each researcher in PlumX. You can look up an author by either our PlumX identifier or their ORCID.

Script

Placeholder and parameters

attribute values default value description
data-no-name true | false false If true, hides researcher name
data-no-description true | false false If true, hides researcher description
data-no-stats true | false false If true, hides statistics section
data-no-artifacts true | false false If true, hides "recent artifacts" section"
data-num-artifacts 5, 10 or 20 5 Number of artifacts to display
data-width any positive integer 350px If specified, the widget will conform to the specified width (any valid css width)

Grant Widget

We provide an embeddable widget for each grant in PlumX. You can look up a grant by it's PlumX URL.

Script

Placeholder and parameters

attribute values default value description
data-no-name true | false false If true, hides grant name
data-no-researchers true | false false If true, hides researchers section
data-no-stats true | false false If true, hides statistics section
data-no-artifacts true | false false If true, hides "recent artifacts" section"
data-num-artifacts 5, 10 or 20 5 Number of artifacts to display

Combined widget script

If you embed multiple types of widgets on the same page, you can reduce the number of resources that need to be loaded by using our combined widget script, which contains all of the widgets, but is a little bit larger than the individual scripts: