roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roller-User" <>
Subject Delivering blogs as Javascript
Date Fri, 02 Nov 2007 09:25:20 GMT

I would like to do the following:

Allow an external user to put a script tag on his site similiar to this:

<script src="http://mysite/roller/blogname/page/javascript"></script>

Now, this url should deliver a valid Javascript whom forinstance could do
one document.write("blogcontent")

Thus the content of the blog is delivered externally. This requires a few

1) That the javascript.vm sets the Content-type to text/javascript. I can
do this through a custom Model. Problem solved
2) That I can get the output of another Velocity file and sanitize it so
it can be written out as a javascript variable.

Let's assume I can display the content of the blog in a Velocity file
called layout.vm.

Imagine this was possible for javascript.vm

-- start javascript.vm --
#set($page = $model.weblog.getPageByName("layout") )
#set($content = #parse($
#set($content = $myCustomModel.prepareForJavascript($content) )
-- end javascript.vm ---

Line 3 in above file obviously returns an error due to the way Velocity
works. My question however is, whetever there is another way to do
something similiar within the Roller API(s)?

Søren Wiuff

View raw message