OPML Renderer

This page and the OPML Renderer are deprecated. In a few seconds, you will be automatically redirected to the page for Optimal, which now can be installed as a WordPress plugin.

OPML Renderer renders valid OPML from any source as an expandable/collapsible list.

XSL stylesheets are used to transform the OPML from XML to HTML. Two XSL stylesheets are included: one for use in pages or posts and one for use as a sidebar item .

OPML Renderer is invoked through either a new content filter or a new template function.

To access the content filter, use the following in a page or post (without spaces):

!OPMLRender : url,updatetime,page|sidebar

To access the template function, use the following:

<? OPMLRender('url','updatetime','page|sidebar'); ?>

  • 'updatetime' is the number of seconds to cache a file before requesting an update
  • 'page' or 'sidebar' indicates which XSL transform to use

Click here to download the latest version.

This is beta software, so please use with caution and report any problems.

Images are included as of version 0.5.

Thanks to iconophobia and the inlineRSS plugin for some code and ideas.

And great thanks to Dave Winer for his work on OPML.

Installation

  1. Unzip opmlRenderer.zip into your plugins directory. It should automatically create a new subdirectory.
  2. Activate the plugin.

That's about it!

You may want to edit the XSL stylesheets to use your own icons or change the appearance of the rendered HTML. Links to do so are provided in the plugin's description on the Plugin pane of the Admin panel.

Errata and Gotchas

I'm very sorry. At least I didn't destroy your data, right?

  • [+/-]Version 0.6
    • opmlRenderer.php - Bug in OPMLContent function prevents usage of content filter with remote URLs that have a query string. (fixed in development version)
  • [+/-]Version 0.5
    • opmlRenderer.php - Error in error message handling. (fixed in development version)
    • Should probably find a way to indicate that remote OPML is being fetched. (done in development version)
    • [+/-]Need to rework the XSL stylesheets' determination as to whether or not to use bulleted lists or bullet certain list items. (done in development version)
    • Need to see if plugin works as expected with WordPress 2.0 (done in development version) and PHP 5+ (OPEN)
    • Need to turn off caching of local files. (done in development version)
    • Need to fix XPath expressions, e.g., from @htmlUrl to @htmlUrl!="". (done in development version)
    • [+/-]Long-term goals:
  • [+/-]Version 0.4
    • Currently generating valid XHTML 1.0 Transitional. If you're using a different version, your pages probably won't validate unless you tweak the XSL stylesheets.
  • [+/-]Version 0.3
    • Not generating valid XHTML. My mistake! I'm fixing this for the next release.
    • Using a variable with the same name as a parameter. Will fix.
  • [+/-]Version 0.2
    • If you're using the :before CSS selector to generate "fancy" bullets on list items, you probably will still want to edit your CSS to eliminate those fancy bullets. For example, here's my stylesheet.
  • [+/-]Version 0.1
    • Dies on any failure to grab your OPML file. I will change this behavior so that instead it loads the cache file, if available, and if no cache file is available, it will die more gracefully.
    • Uses CSS classes in the XSL stylesheets, which you probably have not defined. I will change them to use explicit CSS styles.

Changes

  • [+/-]Verions 0.6
    • (There should be stuff here, but I seem to have over written this file with an older version. Basically, I fixed all the errata in version 0.5.)
  • [+/-]Version 0.5
    • New feature - OPML inclusion.
    • All files - Having learned more about creating WP plugins, the javascript was moved to the document head.
    • Images are now included.
  • [+/-]Version 0.4
    • opmlRenderer.php - Deletes cache file upon XSLT processing error, because this error is usually caused by a corrupt cache file (usually, an error page cached when trying and failing to grab a remote OPML file).
    • opmlRenderer.php - Changed the regex to capture and discard paragraph elements that get added by the wpautop filter. Necessary to enable the page to validate.
    • opmlRenderer-page.xsl, opmlRenderer-sidebar.xsl - Corrected some invalid XHTML.
    • opmlRenderer-page.xsl, opmlRenderer-sidebar.xsl - Renamed a variable that had the same name as a parameter.
    • opmlRenderer-page.xsl, opmlRenderer-sidebar.xsl - Added a div wrapper to rendered text to give user more flexability to change the presentation.
  • [+/-]Version 0.3
    • opmlRenderer.php - Added a check to ensure that allow_url_fopen is enabled if a remote OPML file is requested. Will emit an error message upon failure without dying.
    • opmlRenderer-page.xsl, opmlRenderer-sidebar.xsl - Cleanup and more CSS class sanitizing. No classes are used. Lists should render better on Internet Explorer.
    • opmlRenderer-page.xsl, opmlRenderer-sidebar.xsl - Changed the rendering of reading lists. The title always links to the home page (if available), and the feed may be viewed by clicking the XML icon.
  • [+/-]Version 0.2
    • opmlRenderer.php - Changed behavior upon failure to grab the specified OPML file or XSL stylesheet. Now, instead of dying upon failure to grab the OPML file, the cache file is displayed, and if there is no cache file, an error message is displayed and script execution continues. If the XSL stylesheet cannot be read, an error message is displayed and script execution continues.
    • opmlRenderer.php - Added a comment to the end of the rendered HTML if the cache file was used.
    • opmlRenderer-page.xsl, opmlRenderer-sidebar.xsl - Changed to use CSS styles instead of CSS classes, since users (other than the author) would not likely have those CSS classes (nobullet, blogrollbutton, opmlFolder) defined. N.B. - continues to use "nobullet", but only certain users should be affected (see errata).
  • [+/-]Version 0.1
    • Created

WordPress › Plugin: OPML Renderer « WordPress Support

78 comments

  1. Hey Dan, just heard about your Optimal, came for a download.

    While I’m here, I need to ask: is the latest Renderer the only one that has the RSS img button next to each file when it is expanded? Basically, I’m not sure what version I have right now.

    Second, if you expand my list on my sidebar, you will notice that the 4-5 file down the list is not indented like the rest, is that something that can be rectified?

    You the man, heading towards your Optimal now. Thx.

  2. I see you’re not gonna answer for some reason but I’ll tell you anyway, renderer wouldn’t work in my new theme which has the sidebar on the left side because the click box was outside the margin (pushing it in with the CSS squcished everything together too close) so since you haven’t answered either question I had about Renderer or Optimal, I won’t be able to use either one (sounds just like Winer when he wouldn’t answer questions either). You people are so trying to get stuff out there but won’t help anybody do it and I’ve never even met either one of you, what the hell is the matter with you people? Jerks, that’s what the problem is. Winer and his trolls, guess I was right (you obviously read my post on DW, how shallow of you).

  3. Billy, I don’t know you. I don’t know or care what you wrote about Dave Winer. My life doesn’t revolve around answering your questions that you should be able to answer yourself. I’ve been quite responsive to your many prior comments.

    If you don’t like OPML Renderer, don’t use it. I made it for me, not for anyone else. I’m not selling anything here. This is my hobby, not a marketing tool.

    If you thought your prior questions were going unnoticed, the polite thing to do (if your questions were so important) would have been to post a simple “nudge.”

    If posting nasty comments about people on your blog makes you so paranoid that you think I’m trying to get back at you, you probably should stop posting nasty comments.

  4. fine, forget the whole Dave thing and I realize that I’m not Mr #1 on your list or whatever but why put something out there and then not respond when someone posts a question that obviously sat on your site for over a week?

    maybe you were on holiday or something at which point I’m sorry but I get so frustrated at stuff like this and I know it gives me a bad name but how else am I supposed to get hel because you’re right, I don’t know you?

    I never said I didn’t like the Renderer, I loved it, I’m just letting you know that it doesn’t work on the left hand side for me (and I assumed you weren’t gonna answer that because you never answered the previous post about one of the links not working once it was expanded, even after deleting the first link that it happened to because I thought it may have had some bad characters which were throwing the alignment off on my end). How was I supposed to answer that myself when I don’t see the code being used because it is coming from your script and can’t do anything about it anyway? I was just trying to help by pointing out something I was seeing on my end but since you still haven’t acknowledged it, I assume it’s my end only for that one occurence 4 or 5 nodes down when expanding the list.

    Sorry for all the trouble. I will definitely use it again if/when I go back to a right-handed sidebar theme.

  5. …why put something out there and then not respond when someone posts a question that obviously sat on your site for over a week?

    I think you have a fundamental misunderstanding of what this is. I make no representations of any kind about this plugin or my support of any problems with the plugin. That’s the nature of software like this: caveat emptor. Hell, I hesitate to even call it “software,” since I’m not a developer, I’m just a hobbyist.

    I just put this thing I’ve done for myself out in public in case someone else wants to do the same thing and finds my work helpful. I’m just sharing.

    In so doing, I’ve also gone to lengths to which I wouldn’t ordinarily go to make it as easy as I can for users to help themselves. To wit, your left sidebar problem.

    There is CSS in the rendered HTML that you can use to spindle and mutilate the results to an almost limitless extent. You’ve got the source code. As far as I’m concerned, asking for more is akin to asking me to design your website. If I’m in the wrong, then so be it.

    As it is, I have spent nearly an hour of my day reading your comments from today, researching information to include in my responses, and writing my responses. For free. You’re welcome.

  6. I’m sorry I caused all this trouble.

    I did play with the CSS before coming here but it just pushed each link title too close together within the small space of the sidebar. Maybe it wasn’t going for the Renderer title itself where the expandable click box is (which is the only part sticking out).

    Either way, I see that it is none of your concern and rightly so (this same situation has arisen at other sites as well), I guess I was just mad at myself for not figuring it out before coming here crying about it.

    Peace.

  7. Hi Dan,

    Thanks for the nice plugins and OPML-thingies. I am playing around with the OPML Renderer now, and found it not working properly in the Lush theme I am using now. It does show the expanded feedlists, but the “clollapse” button doesn’t work.

    I’m not a programmer either but I assume it’s something in the theme’s CSS that is causing this, since it does work when using the default WP theme. Would you have an idea where to look?

    Thanks anyway.

  8. Tibor,

    I took a look at the Lush theme. It’s very nice looking, but it really hacks its way around the WordPress loop. The reason the OPML Renderer plugin doesn’t work is because the Lush theme does not use the wp_head() function in the header.php file. So no WP plugin that needs to add things to the <head> part of the HTML (such as JavaScript) will work. Try adding a call to wp_head() (i.e., <?php wp_head(); ?>) somewhere in header.php between the <head> tags and see if that solves the problem without breaking the theme. Then let the author of the theme know if it works.

  9. 🙂 So far so good: the theme is in tact and the collapse feature works. THANKS!

    I’ll update the author too.

  10. Woo! This has been a godsend. I have like 100 of blogs in my bloglines.com opml and being able to do it your way rocks. Now all that’s left for me to do is figure out how to nudge the contents of it over to the right about 10 pixels and i’m rockin.

    I thought it didnt work because going to a bloglines OPML file shows nothing (Firefox). However if you view source, or save as, you can get the OPML file to import into your own rss reader.

  11. got it – the editor has to load the feed once, before it gets displayed.
    Really great plugin, much power with one line of text.

  12. I think I miss the trick.
    What mechanism I have to use that updates my opml
    file automatically with recent rss content?

  13. Hi!

    I’ve been trying to translate the chain “Contributors” into Spanish, but I just don’t find where it is stored… any help would be appreciated 🙂

    Thanks in advance.

Comments are closed.