|
Channel Surfing 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"?> 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 ExplorerYou 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> 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> 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"> NetscapeOk 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
<CHANNEL> The logo/image tag information is in a section separate from the channel definition:
<IMAGE> And following this, you can add the <ITEM>s, which are the headlines and links to the news posted on your site.
<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 ThingWell 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: 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.