Managing Your Links List in Radio

The goal is to provide a list of links that appear on my weblog home page that is easy to edit. The default link list macro in Radio, the navigatorLinks macro, had little formatting flexibility and was difficult to edit. I originally tried Jon Udell’s “my subscriptions” macro – but the resulting list of links had no categorization – other than alphabetical – so readers would have to do their own hunting to find links that were useful to them. (Note: The list of links to the left is now maintained using this solution.)

I stumbled upon this post at CE Grenier’s site that documented an ideal solution: creating an outline in Radio that would automatically publish the links to my home page. Because I could sort the links and add my own categorization, it was exactly what I was looking for. However, in getting the macro to work I noticed a few tweaks that make the process smoother. This is my attempt to document it so that if you want to add your own link outline to your page, you’ll know how. It’s not exactly a simple process, but it is straight-forward. If I’ve left anything out, please let me know. Full disclaimer: I didn’t modify the underlying code that Charlie documents at his site; I’ve simply added more documentation of the process. (I also named my file links.opml instead of interests.opml because it seemed more logical to me.) Many thanks to CE Granier for creating this solution; it’s always nice to find exactly what you want!

Step 1: Create the Links Outline
Start Radio if it isn’t running. When it’s in the task bar, right-click on the Radio icon, select “Open Radio.”

Click on File | New in Radio. A window titled Untitled will open. Save the file into your www/gems folder. (This is most likely at C:/Program Files/Radio Userland/www/gems if you’re a Windows user.) For this exercise, I called my file “links.opml”.

Create your outline. The first line must read: #renderOutlineWith “linksListRenderer”. From there, I created top-level categories and then indented the list of links below. Type in the name you want for each link, then highlight the item and select “HTML | Add Link”. Type in the URL and click OK. (A nice shortcut: if you have copied the URL into the clipboard, you don’t have to type the link in: selecting “HTML | Add Link” simply adds the URL automatically.)

Save the file.

Step 2: Add a renderer to radio.root
This sounds a bit spooky for us non-developers, but once you know where to look it’s not that hard. First step: in the Radio application again, click on “Window | radio.root”. This should open a window that contains seven top-level entries: examples, scratchpad, suites, system, user, websites, and workspace. (If any of these outline entries are expanded, select “Outline | Collapse Everything” and that’ll clean it up.)

Double-click on “user”, then double-click on “html”. An item underneath html should be “renderers”. Double-click on it. Click on any one of the entries, then hit the enter key (you may need to hit it twice). A new line should appear that reads “item #1”. Delete “item #1” and type in “linksListRenderer”.

While the cursor is still on the line, click in the lower left corner of the “radio.root” window on “Kind”. A list of options pops up; select “script”.

Now double-click on the “linksListRenderer” line where it says “1 line”. This should open a new window with a blank line. This is where you add the script that renders the outline into html for inclusion in your home page.

The script is available here. (Right-click that link, select “save as” and save it to your hard drive.) Open the file in a text editor like Notepad, and copy the entire contents of the file to the clipboard (hit ctrl-c when the text is highlighted). Now go to the new window with the blank line entry. Paste the contents of the text file into the blank window. Click “compile”.

Close the window.

Step 3: Install the renderDesktopFile macro
Now you need to install a macro provided by Userland that allows Radio to render the file properly. The macro is here (right-click, select “Save as” and save it to your hard drive). In the Radio application, click “File | Open” and find the file you just downloaded. After you open it, it will ask you for a name for the imported object.

Click OK.

Step 4: Add the Macro to Your Homepage Template
Almost there. Go to your desktop website. Click on Preferences, then select “Home Page Template” under “Templates”. Decide where on your page you want the list of links to show up – and insert the following command:
<workspace.renderDesktopFile(“c:\program files\radio userland\www\gems\links.opml”)>
Note: if you named your links outline file a different name, be sure to change the path.

Click submit. At this point, Radio should republish your home page. Assuming all went well, you’ll now have a list of links on your home page maintained in your Radio Outliner.

Step 5: Maintaining Your Links
At this point, adding a new link to your home page is as simple as opening the links.opml file, typing in the new link name and selecting “HTML | Add Link”, then saving the file. If you want to add the new information right away, select “Radio | Publish | Weblog home page”, or just wait until you add a new post.

That’s it! Good luck.