New Benefits RSS

Examples

Link: Open in a New Window

Perhaps the easiest method, creating a link to a New Benefits RSS benefit feed that opens in a new window will work in almost any web environment.

First, we'll copy an iFrame link from the Content Manager. It should look something like this:

http://content.newbenefits.com/Feed.aspx?hash=mF32gJrBQZIqHePjWTBxQ

Then, we'll create a normal page link, using an anchor tag and our iFrame link URL, targeting "_blank", which tells the link to open in a new window. We'll also remove the "http:" so your links will tell the browser to pull http or https, respectively:

<a href="//content.newbenefits.com/Feed.aspx?hash=mF32gJrBQZIqHePjWTBxQ" target="_blank"> Click Here to view the Feed
</a>

The result is this:

Click Here to view the Feed

Multi-Feed Link: Open in a New Window

Using the Multi-Feed link we learned how to build in the Introduction section, we can open a benefit URL in a new window that displays more than one section of a feed in the order we choose. In this example, we'll choose the General Information sub-feed, followed by the Part 2 subfeed.

Our link URL will look like this:

http://content.newbenefits.com/MultiRead.aspx?Hash=mF32gJrBQZIqHePjWTBxQ
&Sections=1060,General%20Information|1060,Part%202

Then, we'll create a normal page link, using an anchor tag and our Multi-Feed Link URL, targeting "_blank", which tells the link to open in a new window. We'll also remove the "http:" so your links will tell the browser to pull http or https, respectively:

<a href="//content.newbenefits.com/MultiRead.aspx?Hash=mF32gJrBQZIqHePjWTBxQ
&Sections=1060,General%20Information|1060,Part%202" target="_blank"> Click Here to view the Feed
</a>

The result is this:

Click Here to view the Feed

To use this example on your page, copy the code above and substitute your benefit link that's specific to your group.

Link: Using an iFrame

  • Individual iFrame

    The following example shows how you can open an iFrame "window" on a webpage, where the "src" is the page displayed in the iFrame. The frameborder has been set to "1" in order to see the edges, but will normally be "0" to appear as part of the current page:

    <iframe src="http://content.newbenefits.com/Feed.aspx?hash=mF32gJrBQZIqHePjWTBxQ" width="525" height="100" scrolling="auto" frameborder="1" ></iframe>

    The result of which is:

    IMPORTANT: If your site is secure (https), make sure that your iframe link is also secure (https) or it will not show its contents in more restrictive browsers (Safari, etc.).

  • Linking to a Named iFrame

    In this example, we have an iFrame that starts as an empty black box (src="") whose name is "maintarget". It's important to name the iFrame in order for the links to know where to load the page when they're clicked. Again, the frameborder has been set to "1" in order to see the layout:

    <table width="80%" border="1" cellspacing="0" cellpadding="5">
      <tr>
        <td colspan="2">title header here</td>
      </tr>
      <tr>
        <td width="10%" align="right" valign="top">
          <p><a href="//content.newbenefits.com/Feed.aspx?hash=mF32gJrBQZIqHePjWTBxQ" target="maintarget">Dental</a><br />
          <a href="//content.newbenefits.com/Feed.aspx?hash=mF32gJrBQZIqHePjWTBxQ&section=Part%202" target="maintarget">Vision</a></p>
       </td>
        <td width="90%" valign="top" align="left"><iframe src="" scrolling="auto" frameborder="1" name="maintarget" height="200px" width="100%"></iframe></td>
        </tr>
        <tr>
            <td colspan="2">footer here</td>
        </tr>
    </table>

    The result of which is:

    title header here

    Dental
    Vision

    footer here

    IMPORTANT: If you plan to have multiple iFrames on a single page, you MUST have a unique name for each iFrame.

Multi-Feed Link: Using an iFrame

  • Individual iFrame

    More than one New Benefits RSS feed can be displayed within an iFrame using the Multi-Feed Link. In this example, we'll choose the General Information sub-feed, followed by the Part 2 subfeed. The frameborder has been set to "1" in order to see the edges, but will normally be "0" to appear as part of the current page:

    <iframe src="http://content.newbenefits.com/MultiRead.aspx?Hash=mF32gJrBQZIqHePjWTBxQ
    &Sections=1060,General%20Information|1060,Part%202"
    width="525" height="300" scrolling="auto" frameborder="1" name="nbframe"></iframe>

    The result of which is:

    IMPORTANT: If you plan to have multiple iFrames on a single page, you MUST have a unique name for each iFrame.

  • Linking to a Named iFrame

    In this example, we have an iFrame that initially loads the New Benefits website (src="http://www.NewBenefits.com") whose name is "maintarget". It's important to name the iFrame in order for the links to know where to load the page when they're clicked. Since we can control which subfeed shows up first with the Multi-Feed Link, when "Dental" is clicked, the iFrame will load the General Information sub-feed, followed by the Part 2 sub-feed. When "Vision" is clicked, the iFrame will load the Part 2 sub-feed, followed by the General Information sub-feed.

    Again, the frameborder has been set to "1" in order to see the layout:

    <table width="80%" border="1" cellspacing="0" cellpadding="5">
        <tr>
            <td colspan="2">title header here</td>
        </tr>
        <tr>
            <td width="10%" align="right" valign="top">
                <p><a href="http://content.newbenefits.com/MultiRead.aspx?Hash=mF32gJrBQZIqHePjWTBxQ
    &Sections=1060,General%20Information|1060,Part%202
    " target="maintarget2">Dental</a><br />
                 <a href="http://content.newbenefits.com/MultiRead.aspx?Hash=mF32gJrBQZIqHePjWTBxQ
    &Sections=1060,Part%202|1060,General%20Information
    " target="maintarget2">Vision</a></p></td>
            <td width="90%" valign="top" align="left">
                 <iframe src="http://www.NewBenefits.com" scrolling="auto" frameborder="1" name="maintarget2" height="300px" width="100%"></iframe></td>
        </tr>
        <tr>
            <td colspan="2">footer here</td>
        </tr>
    </table>

    The result of which is:

    title header here

    Dental
    Vision

    footer here

Post: ASP.NET HttpPost

The HttpPost method produces one of the most desirable results: an seemless RSS feed on your site that looks like it's part of your site that can also be searched and indexed by search engines. View the HttpPost Implementation page to download the required DLL file.

After placing the DLL file in your bin folder at the root of your site, insert the following code into your page where you want the RSS feed to display:

<% Response.Write(NBHttpPost.Post.Post("http://content.newbenefits.com/FeedNoCSS.aspx?
hash=mF32gJrBQZIqHePjWTBxQ")) %>

The result is this:

Congratulations!

The RSS Feed is pulling correctly from New Benefits.

RSS

ERROR

Note: A feed posted in this manner will inherit any style determined by that page's stylesheets.

You can also post multiple sub-feeds in any order with the following code:

<%
Response.Write(NBHttpPost.Post.Post("http://content.newbenefits.com/FeedNoCSS.aspx?
hash=mF32gJrBQZIqHePjWTBxQ"))
Response.Write(NBHttpPost.Post.Post("http://content.newbenefits.com/FeedNoCSS.aspx?
hash=mF32gJrBQZIqHePjWTBxQ&section=Part%202"))
%>

or, usisng the Multi-Feed Link:

<%
Response.Write(NBHttpPost.Post.Post("http://content.newbenefits.com/MultiRead.aspx?
Hash=mF32gJrBQZIqHePjWTBxQ&Sections=1060,General%20Information|1060,Part%202"))
%>

The result of either is:

Congratulations!

The RSS Feed is pulling correctly from New Benefits.

RSS

ERROR

Note: All New Benefits RSS feeds follow the same format where the title of the feed is in a heading tag "<h1>" and the text is within paragraph tags "<p>." To change their style, your stylesheet will need to address both the <h1> and <p> properties.

Post: Classic ASP

For users of classic ASP, the example below shows how to insert New Benefits RSS feeds seemlessly into your site while allowing your pages to be searched and indexed by search engines.

First, we'll copy an iFrame link from the Content Manager. It should look something link this:

http://content.newbenefits.com/Feed.aspx?hash=mF32gJrBQZIqHePjWTBxQ

Next, we'll change the page name from "Feed.aspx" to "FeedNoCSS.aspx" in order to remove any CSS stylesheets and inherit your page's stylesheet:

http://content.newbenefits.com/FeedNoCSS.aspx?hash=mF32gJrBQZIqHePjWTBxQ

Then, we'll insert the ASP code and change YOURURLHERE to the link above:

<% 
    url = "YOURURLHERE" 
    set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") 
    xmlhttp.open "GET", url, false 
    xmlhttp.send "" 
    Response.write xmlhttp.responseText 
    set xmlhttp = nothing 
%>

The result is this:

Congratulations!

The RSS Feed is pulling correctly from New Benefits.

RSS

ERROR

Again, you can also use the Multi-Feed Link in order for the page to display more than one section in order you choose.

To use this example on your page, copy the code above and substitute YOURURLHERE with a link from the New Benefits Content Manager.

Have Questions?

Contact us today to get started.

Contact Us


Contact Information

Phone: 800.800.8304
972.404.8192
Fax: 972.991.5218
Email: info@newbenefits.com

New Benefits, Health & Medical - General, Dallas, TX