#title "storyBox"
#opmlStory "http://radio.weblogs.com/0104487/gems/opml/storyBox.opml"
#renderOutlineWith "activeRenderer"
What is storyBox ?
storyBox is a UserTalk macro command that returns the last date of publication.
In addition, it returns a white-on-orange XML button with a link to the story's OPML content, if the story is rendered out of an OPML outline, with the help of my opmlRender macro.
Installing storyBox.
Just save a copy of storyBox as a text file in your Radio application Macros folder.
I use a call to this macro in the upper right corner of my stories Radio template, stored as www/stories/#template.txt.
How does it work ?
The date of publication is retrieved by calling the now() method of Frontier's clock object.
storyBox returns an XML button based on the existence of the #opmlStory directive in the story's body.
The correct syntax is #opmlStory "url" where url is a local or preferably remote url for the opml version of the story.
This story for instance has only 2 lines :
#opmlStory "http://radio.weblogs.com/0104487/gems/opml/storyBox.opml"
<% opmlRender ( opmlStory, "story" ) %>
Check that the HTML version of this tutorial has an XML button link at the top right corner of the page.
If you copy that link, you can open the tutorial in an outline editor by selecting File / Open Url... in Radio.
All the elements returned by storyBox are encapsulated in <div> tags with the default storybox CSS class.
I've defined the .storybox class in my stories template with a margin-top and margin-bottom of 0px.
You can create a storybox CSS style according to your need.
Alternatively, you can ask storyBox to use a different CSS class by passing its name between quotes as a macro's optional argument.
eg: <% storyBox ( "footer" ) %>
How's that for customizability ?
Ouch, this one is not in my Collins dictionary yet :-)

