Written by: Karen Suhaka | January 28, 2019

If you would like to create a widget to display all bills introduced by a specific legislator(s), there are two basic approaches. For an example see any state legislator page on Ballotpedia, like the one for Alec Garnett.

Approach 1 – Legislator Widget

The code for this widget is simple:

<script src=”https://www.billtrack50.com/Scripts/bt50.legislatorWidget.js” type=”text/javascript”></script>
<script type=”text/javascript”>
BT50.Widget({
apiKey: “yourkeyhere”,
legislatorID: 19709,
rowCount: “25”,
backImage: “flat”,
borderColor: “#9C9C9C”,
linkColor: “#0b0080”,
fontFamily: “Verdana, Arial, Helvetica, sans-serif”,
height: 300,
tBackground: “#CCCCCC”,
tForeground: “#444444″,
width: 500,
currentSession: false
});
</script>
<div id=”BT50Widget”></div>

To fill in the API key make a widget in your account and copy and paste that info into this widget. To get the legislatorID look up the legislator you would like to follow and grab their id from the URL of the BillTrack50Page (example). The rest of the information is much like our other widgets, customize as needed. Notice the last item, currentSession, that lets you limit the bills to just the currentSession, as you possibly already guessed. Also notice the rowCount, limiting how many bills are shown — you can increase that number up to 300 if you’d like more bills included.

Approach 2 – Bill Widget tied to a Legislator(s)

If you need more options you can also create a bill sheet that follows one or  group of legislators. Here are the steps for this second option:

  1. Create a new bill sheet limited to a single state, with no search terms
  2. Once you have the bill sheet add the state code (like CO for my example above, remember we use US for Congress)
  3. Select one or more legislators from the legislator dropdown (start typing the last name to see your list of options)
  4. Save and go to the Widget tab to set all the options and get the code for your new widget

As you see it’s easy to create a legislator widget. So get out there and start getting people informed!

PS If you are a legislator and would like to display your bills on your own website automatically, contact us. We’re happy to give you the code for your own widget if you would like it, no charge.