Macrobyte Resources Weblog 2.0
Internet groupware development platform
Weblog II Beta Site




 
January, 2005
Sun Mon Tue Wed Thu Fri Sat
  1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31  
Jul  Feb

<-- Back One Week



Day Link Icon 1/25/2005

weblog.listChannels Macro

(by Seth Dillingham, @ 12:20 AM)

Though it's a little later than I had planned, I've posted the documentation on the new weblog.listChannels macro.

It includes examples.

Hey actually, looking it over I see that it even reveals a bug in the code.

It's not a serious bug. Three and a half points to the first person to spot the bug.

Comments: 5 | Reply | Categories:



Day Link Icon 1/24/2005

JavaScript Syndication

(by Seth Dillingham, @ 2:31 PM)

Though not as popular as RSS, JavaScript-based syndication has some interesting possibilities and shouldn't be ignored.

The new options in Weblog II make it possible to "publish" part or all of your weblog to any other page or site. Even a static site can use it!

The attached file is an EXTREMELY simple HTML document. The head section loads a couple of stylesheets, and the body of the page only has a single tag: it loads a javascript from the server.

Download the file to your computer's desktop and look at the source (open it in a text editor). Then, open the file in your browser.

Pretty nifty, no?

The "server side" of this feature -- meaning, what you do in your Conversant site to make this work -- is just as simple as what you see in the HTML file.

  1. Put a macro into a new message, but use it in a javascript document.write command, like this:
    document.write( "<!--#weblog.pageWrapper pageId="weblog2beta/index" jssafe="true"-->" );
  2. "Bind" that message, publishing it to a URL like /index.js or syndic8.js or whatever you want
  3. Open the Files and Folders section of the admin area, and edit the properties of your new page.
  4. Set the page template to "Content Only READONLY"
  5. Set the MIME type to "text/javascript"
  6. Save your changes.
  7. Switch to the "Options" panel of the page's properties.
  8. Change the page's Wrapper Template to "Bound Msg Body Only READONLY"
  9. Save your changes

So, most of the work is acutally done in the admin area. Total time: 5 minutes or less.

Also, the output from the javascript doesn't have to look just like the real weblog as it does in this example. The weblog.pageWrapper and weblog.days macros both allow you to override the templates used when rendering the weblog, so your javascript-syndicated template could look completely different from the main weblog page.

Perhaps not a solution to every syndication-related problem, but it's a tool worth having in your toolbelt.

Any questions?

Comments: 4 | Reply | Categories:



 
© 2002 Macrobyte Resources. All rights reserved.