You are not logged in Log in Join
You are here: Home » Members » karl » BlogFace » BlogFace » how to blog a wiki » View Document

Log in
Name

Password

 

how to blog a wiki

How to blog a ZWiki.

A wiki is a weblog - just hang out at RecentChanges. This isn't very interesting, however.

Others have worked at incorporating weblogs into their wikis: http://pikie.darktech.org/cgi/pikie.py?WebLogUsage http://webseitz.fluxent.com/wiki/FrontPage

I wanted something that adapts to the wiki, rather than making the wiki adapt to it (no special syntax in the pages, or multiple entries per page, etc.).

This is a first cut on using BlogFace to add a weblog interface to a ZWiki, by using the creation date as the date of the blog entry corresponding to a wiki page. The beauty of this solution is that you can just add a wiki page and not think about anything, and bang, it's a blog entry with a date and everything. And you can combine wiki pages with other objects as your blog entries. You could also have several BlogFace interfaces to the same wiki - for example, one which uses the creation date as the blog date, and one which uses the last modified date.

There are probably some rough edges left, I haven't poked at it too hard.

I have an example online.

Instructions:

Install a ZWiki in a folder with an ID of "wiki" (IDs can be changed to taste, of course).

Add a method that will return an ISO formatted string for the date you want to blog the wiki pages under. Put this method somewhere where the zwiki pages will acquire it. The easiest way is to add a Script(Python) in the wiki folder or a parent folder. For example, to blog under the creation date, add a Script(Python) with this body:

    try:
      return context.manage_change_history()[-1]['time'].ISO()
    except KeyError:
      return context.bobobase_modification_time().ISO()

Add a method that will return the text of a wiki page, rendered in the appropriate way (WikiLinks, etc.). To do this, add a Script(Python) with this body:

    request = container.REQUEST 
    RESPONSE = request.RESPONSE 

    if not request: 
    request={} 
    request.set(bare, 1) 
    return context(REQUEST=request, RESPONSE=RESPONSE) 

Install a ZWiki catalog in the wiki folder - see HowToInstallAZwikiCatalog. The catalog doesn't have to be a child of the wiki, in fact, if you want to blog other objects, it probably shouldn't be. Make sure that the attributes that you want to be blogged, including the date and body attributes given by the Scripts(Python), are in the indices or metadata of the catalog.

Install a BlogFace in the parent folder of the wiki folder (although you could put it in the wiki folder, I suppose). For "path to catalog", enter "wiki/Catalog" (or whatever your wiki catalog is). For "date index", enter the ID of the ISO date method you added.

Edit the entry display view for the BlogFace (in dtml/entries) to use your date attribute (and any other attributes that you want to display).