Print this Article (NS4)
Netscape Navigator
Internet Explorer
Opera
Neoplanet

Forums
HTML
General
Programming
Flash
Site Dev
Grafix (Art)

Laboratory
Smart HTML
Color Lab
Generators

HTML Editors
Simple Editor(Win*)
EditPad(Win95)
AOLPress(Win95)
BBEdit(Mac)
Dreamweaver
CuteHTML

Related Files
Font Creator
True Type Fonts
WEFT
Icon Creator

Contents
Introduction to Ultimate Enlightenment
  1. Hello World
  2. Text Formatting
  3. Fonts
  4. Horizontal Rule
  5. Color and Gradients
Body Works
  1. Body Attributes
  2. Header Attributes
  3. Hyperlinks
  4. Cursors
Images and Eye Candy
  1. Adding Images
  2. Image Maps
  3. Making Images
  4. MouseOver Images
Lists and Forms
  1. Bulleted Lists
  2. Ordered Lists
  3. Definition Lists
  4. Nested Lists
  5. Form Input Types
  6. Uploading Files
  7. Field Background Colors
Tables
  1. Rows and Columns
  2. Resize and Remake
  3. Aligning Data
  4. Headers
  5. Swapping Background Colors
  6. Table Frames
  7. Global Table Properties
Frames and those that Float
  1. Framesets, Rows and Columns
  2. Nesting Framesets
  3. Customizing  Properties
  4. Considering the Frameless
  5. Inline Frames
Meta Data
  1. Keywords and Descriptions
  2. Search Engine Analysis
  3. Blocking Spiders and Robots
  4. HTTP Headers
    1. Cache
    2. Refresh
    3. Classification
    4. Safe Surfing
  5. Transitions
  6. Dynamic/Embedded Fonts
Sound of Music
  1. MIDI
  2. WAV
  3. MP3 Streaming
  4. Real Audio
  5. Beatnik
  6. Embedding
  7. Looping
  8. Crescendo (NS)
Channel Surfing
  1. CDF
  2. RSS

Back to the Top


Channel Surfing
By Lisa Hui

Ever wonder how to add active content from your site to an Internet Explorer channel? Or even how to add your site's headlines to a surfer's Netscape Netcenter channel? Well here is the guide, in all its XML glory yet simplicity. Usually, I'd be inclined to say that this isn't a that cool a "trick" but its so simple, why not? So, without further adieu, I introduce you to the .CDF file and the RSS.

Hmm, more acronyms... Well, logically, CDF stands for Channel Definition Format which is a "specification developed by Microsoft that allows Web publishers to push content at users. Once a user subscribes to a CDF channel, any software that supports the CDF format will automatically receive new content posted on the channel's Web server." [PC Webopedia] Aside from that jargon, I'll just say that it is a file that tells a news retrieval program where to find the news on your site :)

Similarly the RSS, a RDF (Resource Description Framework) Site Summary, utilizes XML syntax to allow you to add your site's headlines to a viewer's My Netscape page, although the suffix of the file will be .CDF. The syntax is slightly different between the Internet Explorer and Netscape applications, but you'll see that for yourself in a moment.

To start off, open any text editor you prefer and save this new document with a name that is indicative of your site (end it with the .cdf extension). For this tutorial, I'll be using adinfinitumweb.cdf. It shows up on your computer with this kind of icon-identifier (at least on my Win95):

Now that you have this document open and saved with that file name, you should add an XML identifier tag to the file at the top:

<?XML VERSION="1.0"?>
(Notice that the tag begins and ends with a ?)

This is where NetCenter and Internet Explorer Channel syntax differ (pretty early on, but you can create two different channel definition files for both browsers). Let's start with Internet Explorer because the tags are simpler.

Internet Explorer

You now add the <CHANNEL> container tag, which should have the following attributes: HREF (your page URL), BASE (also your full site URL - used if you didn't specify the full URL in HREF), and SELF (the name of your .cdf file). So far, I have the following elements in my .cdf file:

<?XML VERSION="1.0"?>
<CHANNEL HREF="index.html" BASE="http://library.advanced.org/26297/" SELF="adinfinitumweb.cdf">

</CHANNEL>

Within the <CHANNEL> </CHANNEL> tags, you'll want to include some site description information. Namely, the <TITLE>, the <ABSTRACT>, a little <LOGO /> for your site to display in the channel. The first two (title and abstract) are container elements/tags, so they will be used in the file as <TAG>Information</TAG>. An abstract is a short description of your site or a list of relevant key phrases. Adding these things, my updated .cdf file for this site looks like:

<?XML VERSION="1.0"?>
<CHANNEL HREF="index.html" BASE="http://library.advanced.org/26297/" SELF="adinfinitumweb.cdf">
   <TITLE>Ad Infinitum Web - The Science and Art of Super Charging the Web</TITLE>
   <ABSTRACT>Web Authoring Tutorials and Secrets</ABSTRACT>
   <AUTHOR VALUE="Lisa, Gavin, Michael" />
   <LOGO HREF="aiw-logo.gif" STYLE="image" />
   <LOGO HREF="aiw-icon.gif" STYLE="icon" />

</CHANNEL>

Notice that the <LOGO /> tag ends with a "/>" This is a self-contained XML container (try saying that 10 times fast). You can specify either the channel image (approximately 88x31 pixels²), or both the image and icon (approximately 16x16 pixels²).

For a little ego boost (and copyrighting information), there is an <AUTHOR /> tag which allows you to name yourself the author of the site. There's no real purpose of this except to add to the meta-data revolution :)

You could save the file now and be done with it, but you have the option to add choices or <ITEM>s (which might be used to list your current site news headlines). An <ITEM> set might look like this:

<ITEM HREF="news.shtml" Precache="Yes">
   <A HREF="http://library.advanced.org/26297/news.shtml"> </A>
   <TITLE>Ad Infinitum Web - News and Headlines</TITLE>
   <ABSTRACT>Go straight here for a dose of the latests updates to the AIW brand of tutorials, new tips and tricks, and late-breaking net news.</ABSTRACT>
   <USAGE Value="Channel"> </USAGE>
</ITEM>

Netscape

Ok now that we've gone (or skipped) through the Internet Explorer .CDF file syntax, we're back to square one starting with the Netscape version. This is different because it uses RDF (Resource Description Framework) syntax, which uses "object-oriented terminology" to describe the channel/link information. But we won't be going into that in any depth, we'll be sticking with the schemata to get this Netscape .CDF file created :)

I started a new document and saved it as ad-infinitum-web.cdf and followed with the XML header declaration:

<?XML VERSION="1.0"?>

...Followed by a RDF header declaration:

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://my.netscape.com/rdf/simple/0.9/" >

<CHANNEL>
   <TITLE>Ad Infinitum Web</TITLE>
   <LINK>http://library.advanced.org/26297/</LINK>
   <DESCRIPTION>Web Authoring Tutorials and Secrets</DESCRIPTION>
</CHANNEL>

The logo/image tag information is in a section separate from the channel definition:

<IMAGE>
   <TITLE>Ad Infinitum Web</TITLE>
   <URL>http://library.advanced.org/26297/aiw-logo.gif</URL>
   <LINK>http://library.advanced.org/26297/</LINK>
</IMAGE>

And following this, you can add the <ITEM>s, which are the headlines and links to the news posted on your site.

<ITEM>
   <TITLE>News Subject</TITLE>
   <LINK>http://library.advanced.org/26297/link-to-the-news-article.html</LINK>
</ITEM>

Finally, when you are done adding in all the elements, end the file with a:

</rdf:RDF>

Some CGI news publishing tools, a couple of which you can find in our Perl resource downloads section, have an option to update your .CDF file automatically when you post new news.  If not, I probably hacked it so that it does, and you'll find my modification instructions in that section as well.

Using the Darn Thing

Well that's simple enough. Just create a link (text or image - it doesn't matter) that points to the file. What you might see is the "Add Active Channel" button on the user's site. If your browser interprets .CDF files, it will automatically prompt that you are downloading an application. Here is the Ad Infinitum Web .CDF linked up for Internet Explorer:

Add Active Channel - Ad Infinitum Web

This is a snapshot of the dialog box that pops up when a user clicks the link:

For Netscape, since there's no image actually given to use, I'll use the Netscape cube:

It doesn't actually show any prompts, and the effects are pretty limited, but we'll explore the possibilities as I work with these "add-ons" to this site.

So, in conclusion, this type of file can act as a headlines list updated in real-time, which personally speaking, is a neat tool :)

©1999 Team 26297 "Ad Infinitum Web." All rights reserved. Any reproduction of this document for commercial or redistribution purposes without the permission of the author is forbidden.