How to Create RSS feeds with Dreamweaver

By Ronald Northrip

Feeding the JobBank

Open the JobBank and take a look at it — it's the jobbank.html file in the 03_HumanResource directory. This page is a listing of the pages that are in the JobBank directory, each page is a different entry offering a different job. We can list these same pages in an RSS feed automatically. This is an example where each file is a single story, and we'll be summarizing all the files within a directory.

Open the any Job Description file and examine it. This content represents the story that we'll want to collect for use in our RSS feed. The way we'll collect this content is based on the HTML code used to lay out the content. Take a close look at the content and you'll notice that:

  1. The headline is a H1 but it's the same for all the pages, so it's not a good headline — Job Announcement
  2. The subhead is a H3 but it actually contains the relevant headline content
  3. The story content is in P tags, but there are multiple paragraphs that we'll want to collect

Based on what we just looked at you'll be able to define a feed for this page and use those attributes to identify the content to extract from the page and put into the RSS feed. You're going to go through the same feed creation process as before, but with slightly different settings appropriate to this content.

Enter descriptive information about the RSS feed in the first panel. You'll need to enter the Title of the feed. You also need to enter a Description for the feed. As an option you can include a graphic or icon to be used to represent the feed.

Define the files to summarize in the second panel. Set the first popup to make a summary of a Directory. Then you need to tell it which directory will be summarized - click the little folder icon to the right of the text field. You'll be presented with a dialog box to select a directory — pick the JobBank directory. If we wanted to include sub-directories in our summary you would want to check it, but that doesn't matter for this example because there are no sub-directories. You'll want to add entries to the RSS feed for all new files so set Capture changes to File Creation. Enter the base URL for the website you will be publishing to, it will be used to create the links in the RSS feeds (RSS feed links are full URLs because you never know where the feed will be republished). Set Max stories to 30 because we don't want the feed to contain more than 30 job entries — though this is arbitrary. You can set it any way you like, or leave it blank and there will be no limit. Be aware that unlimited RSS feeds just keep accumulating content, which probably isn't what you want.

Set up headline extraction in the third panel. Set the Match Tag to be H3 (its not case sensitive). Extract the Tag Content to be used as the headline.

Set up story extraction in the fourth panel. Set the Match Tag to be P (its not case sensitive). The paragraphs to include follow the headline, so set the Location to After the Headline. Set Extract the All Matching Tags to be used as the story content. This means that multiple paragraphs will be collected. Finally, limit the length of the story because multiple paragraphs might be a lot of text. Set Max Length to 200 words.

In the fifth and final panel save your new feed.I saved it as "jobbank.rss" right next to the jobbank.html file.

After completing these steps the file for your feed has been created and is now listed in the list of RSS feeds. The list entry indicates that it has never been updated — which means that the feed doesn't have any stories in it yet. So process it and then test the results.

Linking to the Feeds

The last step in setting up your feeds is to link to them. You can do it the same way that you link to any file with Dreamweaver, but that only creates relative links, not Feed:// protocol links, and does not provide alternative content header links. This is how Safari knows to display the little RSS icon in the location bar, or how NetNewsWire knows where to find a feed when given a regular URL. There are some deficiencies in the way that Dreamweaver treats linking to an RSS feed. RSS DreamFeeder provides an interface in the Link panel to address these issues (you may need to make the panel wider to see the Apply buttons — I'd have done it for you but Dreamweaver doesn't allow it).

The panel is broken into two groupings: Alternative Content Link and Hypertext Link.

Alternative Content Link settings provide the way to set up the header links to the feed as an alternative to displaying HTML. If an aggregator see the page it will load the Feed instead of the page. The Link To popup menu allows you to select from the RSS feeds you've already created without having to select the file itself. Click the Apply button to apply your setting to the current page being edited. You can only have one RSS feed alternative per page, so any changes you make will modify that setting for the page.

Hypertext Link settings insert a hypertext link at the selection in the current document. The Link To popup menu allows you to select from the RSS feeds you've already created without having to select the file itself. To change the graphic click on it. You'll be presented with a new popup menu where you can select a different graphic. Upon selection that graphic will be displayed. To use the Feed:// protocol check the box. This alternative protocol is associated with RSS feeds so that news aggregators can be triggered as helper applications from within a web browser. Click the Insert button to insert your link.

To link to our feed for the JobBank open the JobBank file and click on the Link button in the RSS DreamFeeder panel. Set the alternative content to point to your JobBank feed, then click on the page in front of open jobs and insert a Feed protocol link to the same feed. Click after the newly inserted link and press return to put the headline on a new line.

To link to our feed for the home page we have to edit content that isn't available within the file, but rather is only editable in the template. No problem, open the HomePageTemplate file (in the Templates directory), and set up your link and alternative content header.

When you save, Dreamweaver will prompt you to update the pages that the template is based on. Click OK and it will update the home page to include the new links.

Nothing is Perfect

Here a few details about the above process.

1. The content that you created probably has the words "UNREGISTERED" in it somewhere. Until you register your version of RSS DreamFeeder it will continue to include that content in both the headline and the story. You can purchase a serial number for RSS DreamFeeder at http://www.rnsoft.com. Click on the "REGISTER" button at the bottom of the RSS DreamFeeder panel and enter the serial number there.

2. The feed protocol hypertext links you inserted point to some website that doesn't exist, so don't expect them to work. If you did publish the feeds on your website and configured the Base URL part of the feed correctly it would work, but it's good enough for this tutorial.

3. For single page summary feeds like the home page feed we created you'll notice that the dates all say the same thing. They are listing the modified date of the file for each new entry. Since all 3 entries are new, all 3 are listed with the same modified date. If you put a new entry on the home page, and run it now, it's date would be different from the others. Nothing a quick text-editing couldn't fix, but to be fair, it isn't quite right.

4.For directory summary feeds like the job bank feed we created, remember that we configured it to capture files which are based on their creation dates. I duplicated a file and tried to edit it only to discover that by doing so I didn't change its creation date. The solution is to open the file and do a Save As, which creates a whole new file.

That's All Folks

I hope you found this tutorial useful, and I hope that you'll get a lot of use out of RSS DreamFeeder.

About the Author

Ronald Northrip is the President of Ronald Northrip Software, a technology company focused on creating software tools to make developing websites, creating content, and using your computer simpler and better.

This article originally appeared on WebReference.com.

Page 3 of 3

Previous Page
1 2 3

  • Web Development Newsletter Signup

    Invalid email
    You have successfuly registered to our newsletter.
Thanks for your registration, follow us on our social networks to keep up-to-date