|
|
Friday, January 25, 2002 |
|
Using Multiple Styles When Rendering Mark Paschal is my hero for the day. With this innocuous string of posts in the RU Discussion forum he shed light on my problem. I want to create a simple story that includes a table in it. I want the bulk of the story to be a Two Level Outline (headlines and subtext), but I also want to include a table in its midst. In Radio/Frontier terms that usually means creating two files, each using a unique renderer, and then merging the two. Up until now I had not been able to pull this off in Radio 8. I now have, thanks again to Mark. The Solution
#title "New Employee Review" #renderOutlineWith "pikeRenderer" <rules> // omitted for clarity </rules> A Plan For Bringing New Staff Up To Speed We all agree ... going over the topics below: <%renderFile("misc/newEmployeeTopics.opml")%> Here is the file representing my tabular data. As you can see, it is to be rendered using the "newTableOutliner". This is the same as the tableOutliner, but modifed to pick up the page table address correctly per Mr. Paschal's instructions. #renderOutlineWith "newTableOutliner" #flindex false #cellpadding 2 #cellspacing 2 #border 0 #divColor "darkblue" #cbgcolor "white" #width "100%" Topic Expert Review Block Architecture Diagram Mark, Tony, Rene The result is a nicely rendered table in the midst of my story - all appearing as a single document. Here is a copy of the renderFile macro I wrote, (also based on Mark's suggestions). Note that it assumes we are working with a document in the stories directory.
on renderFile(fpath) {
local (foo, fname);
local (pc = file.getpathchar ());
local (folder = user.radio.prefs.wwwFolder +
radio.data.folderNames.wwwStoriesSubFolderName + pc);
fname = folder + fpath;
op.xmlToOutline (file.readWholeFile(fname), @foo, true);
return renderObject(@foo);
}
There are a couple of other notes I should point out. I have added some othe rmods to newTableOutliner, thus the unfamiliar directives. I added the #flindex flag because my table is stored as an OPML document in a stories subdirectory. That means Radio will render it and list it in the Story index. I cannot easily help the rendering, but I really don't want this piece of document showing up in the index. I added a couple of lines to radio.macros.viewStoryList to look for the #flindex directive and skip the file if it is present. I am one happy camper! Thank your Mark P.!!! |