Information Resources & Technology (IRT)

Reader

What is this Reader?

Reader is JavaScript and CSS designed to help you render Newswire and Medevents items on a web page. The simplest case, shown here on right, has a default configuration and CSS, to make it easy for you to drop into any web page.

Potential configurations

Readers can be configured by adjusting a few attributes associated with each instance of a Reader that you create. The styling of the data output by Reader can be influenced with custom CSS.

Newswire Demo: Digest Style


Code

Requires the following in the HEAD of your document:

<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.5.2/build/yahoo-dom-event/yahoo-dom-event.js&amp;2.5.2/build/animation/animation-min.js"></script>
<script type="text/javascript" src="/Templates/ui/reader/reader.js"></script> <link rel="stylesheet" type="text/css" href="/Templates/ui/reader/reader.css" /> <script type="text/javascript"> /* <![CDATA[ */ SM.reader.create = function() { var reader = new SM.reader.init({ // All custom config params shown "elementId" : "reader", // The element id of the reader is inserted into "category" : "irt", // Category to display "readerType" : "news", // Can be "events" or "news" "url" : "/Templates/newswire/published/IRT_News_main.json", // URL to feed you wish to use "numberOfItems" : 4, // Number of items to display "showFirstItem" : true, // In a collapsed list, whether to expand the first item "showAllItems" : false, // If true, all items are expanded "showTitlesOnly" : false, // Shows only titles, no descriptions "shortTitles" : false, // Use long titles "sortOrder" : "normal" // Can be "normal" or "reversed" }); } SM.addToInit(SM.reader.create); /* ]]> */ </script>

Include this in the BODY of your document:

<div id="reader"></div>

Stanford Medicine Resources:

Footer Links: