I just built a template that will let you include the contents of a story. No idea if this is a standard function, so I've rolled it myself:
<%
on readText (leafName) {
local (pc = file.getpathchar ());
local (path = user.radio.prefs.wwwFolder + radio.data.folderNames.wwwStoriesSubFolderName + pc);
local (atts);
local (fn = path + leafName + ".txt");
file.open (fn);
local (s = "");
while not file.endOfFile (fn) {
local (line = file.readLine (fn));
if string.patternMatch ("#", line) != 1 { s = s + line; };
};
return (s);
};
scratchpad.readText = readText;
""
%>
Now, when I want to include a story, I put something like this:
<% scratchpad.readText ("myStoryName") %>
At first I tried using getFileAttributes, but that didn't give me the body text. This way is pretty low level though; there's got to be a function for it somewhere. Anyone know?
12:48:43 AM
|