Editable menus in static files


Radio2 generates two static files, the HTML archive and the Counts page.

Wouldn't it be great if these pages could be integrated into your blog? I sure think so. (Answering my own questions again.)

Turns out we're very close to being able to pull this off in a fairly elegant way!

Plan

New routine, webApp.viewMenuFromOpml, with code cribbed from worldOutlineSuite.roots.viewMenu.

In the template for the HTML archive, add a <%menu%> item. Unless this feature is enabled, it will be the empty string.

Added styles.css and scripts.js to the head section of both templates.

Updated scripting2.root to use the same prefs as Radio2.

Why this is cool

It allows me to tie together all my disparate static stuff under one menu, and when I make a change to the menu, it percolates to all the static pages, next time they build.

Here's a list of pages that are now linked in:

Parts

webApp.viewMenuFromOpml

radio2suite.inituser

radio2Suite.data.html.archiveTemplate

radio2Suite.data.html.staticCountsPageTemplate

radio2Suite.buildHtmlArchive

radio2Suite.buildTop40Html

scripting2Suite.initUser

scripting2Suite.server.setupMacrosTable


Posted on Tuesday, May 08, 2012 at 8:43 AM by Dave Winer.