Thu 4 Dec 2003
Blogs4God voting form macro for Radio Userland
Posted by jmiller under E-Publishing Explosion , Knowledge ManagementI’m testing a variation of this centralized CSS technique for Radio Userland posted by Bryan Bell. The way I’m using this technique is to embed the code for the blogs4God.com voting form.
I was wrong (not any): Basically, any “include” you want to put in a page can be done by means of creating a text file containing the desired include in the root of the affected area (in a category folder or the root of the entire site). The file must start with a pound sign and end (I think, but maybe not) in a “.txt” extension. Then you can refer to it by name in any template “downstream” from the folder that contains the file. Just reference it in the “percent brackets,” in my case <% b4gvote %>, and re-render all affected pages. If this works (see Updates), I will begin doing a lot of “micro-content” this way. I think inline UserTalk script is allowed too, but I’ll have to veryify that.
By the way, I think the choice of using the “#” pound sign to prevent rendering files is pretty cool and clever. Specifically because any incoming request for that file will be interpreted as a named anchor in the default document (if any) for the containing folder or directory. So effectively, “www.xagronaut.com/#b4gvote.txt” is interpreted as “www.xagronaut.com/index.html#b4gvote.txt” which does not exist. So the “hidden” files would never be served up. I wonder though, if the “%” syntax with the character code for the pound sign would retrieve it…
Fun. ![]()
Update: OK, maybe not so fun. I received this error when attempting the technique:
[Macro error: Can't evaluate the expression because the name "b4gvote" hasn't been defined.]
I’m trying again, this time with the major hack of literally what is described in the link above–using the name “cascadingStyleSheet”–it may not be as lovely a technique as I first thought, but I’ll withhold jugdment temporarily.
Update #2: Lame. Yep, that was exactly the problem. Once again, the case of the “hard-coded macro name” strikes. I encountered this first in my problem with the mail-from-aggregator feature in which the templates allow substitutions, but only of hard-coded tags. The administrative interface fools you into thinking that you can completely customize the format of the email. Wrong! While the “percent bracket” syntax is still used, it seems to have an entirely different effect than other references to macros. Booooo! Hissss!
I suppose that I could always opt for server-side includes (SSI) on my web server now that I am hosting my weblog. I wonder if Radio will leave those alone when it renders! ![]()
Update #3: More tweaks…
Instead of using the #cascadingStyleSheet.txt file, my research on category lists on a post led me to this link in which Mark Paschal mentioned “workspace.blog.categories”. The “workspace” part happens to be a writable area for the user’s whim. I ended up creating a “wp text” entry in this area called b4gvote that contained the text of the Blogs4God vote code. In my page template I then reference it as <% workspace.b4gvote %>. This did the trick, and I was able to stop using the other hack.
The good news is that you can use this technique for other purposes too–reusable micro content sections, etc. Insert sigh of relief here.
Mark Paschal has a weblog and a Radio Userland tool set available under a BSD license.
Leave a Reply
You must be logged in to post a comment.



