Using Dynamic Content

From developer.newsgator.com

Jump to: navigation, search

The dynamic content feature allows you to pass a feed Url into a widget as it is being rendered on a page. This is so you can have one widget that acts as a template, and as it is displayed on different areas of your website it will show different content.

1. In the Content section when building a widget, navigate to the "Other" tab. Select the first option Provide Content Dynamically, and specify a default feed Url. This Url will provide content in the event that nothing is passed into the widget.

2. Save & Publish your widget.

3. On the script block that calls the widget, simply include an XmlUrl querystring parameter, like so:

<script
   src="http://nmp.newsgator.com/NGBuzz/buzz.ashx?buzzId=29696
      &apiToken=40FA5D129F5D4FCA85FED3B5FB569560&XmlUrl=http%3A%2F%2Fblogs.newsgator.com%2Fnewsgator_technical_blog%2Fatom.xml"
   type="text/javascript">
</script>

And make sure to URI encode the Url first:

var ng_xmlURL = encodeURIComponent('http://blogs.newsgator.com/newsgator_technical_blog/atom.xml');
Personal tools