Mikedowney.co.uk
What's New
Site Map

Diary
Astronomy
Bits N Bobs
Computing
Food And Drink
Links
Photography
Welcome


Selected Entries
Pinhole Photography
Keeping Quail
Coventry
Recipes
A different recipe each week
Friends websites
Oven Temperatures and Measuring Cups


Most popular stories
A Hamster's Home is his C...
Hamster Peanuts
A Tangfastic Mess
Simple HDR photography wi...
Pizza, Hamsters and Ballo...
Hamster Baby Update
Tiny Koala
Giant Sunflowers
More Squirrel Photos
Hamster Baby Update
Roborovski Babies


RSS Feeds:
RSS Feed Entire Site.
RSS Feed Diary only.



Powered by Blosxom


Pinhole Photography Ring
pinhole webring logo
powered by RingSurf
Next | Previous
Random Site | List Sites

Previewing Posts

Story location: Home / computing / blosxom /
05/Apr/2008

The Blosxom blogging system doesn't have a built in way of previewing posts before making them publicly visible. There are various plugins available but for me they seemed to overcomplicate things.

I have been using the Blosedit post editor which includes a preview option but if any Blosxom plugins are used to alter the page appearance (such as Markdown or photo galleries) then the page won't display correctly.

My solution requires the entriescache plugin to keep track of posted stories. Normally, any stories will only show if entriescache knows about them. I set the delay variable to a high number eg.

$delay = 9999;

to stop the index from being rebuilt unless I say so. This means that I can add new posts without them showing, until I tell it to rebuild the index.

To display all posts, not just those in the index, I made the following change to entriescache:

sub start {
    # Force a reindex
    $reindex = 1 if (CGI::param('reindex'));
    return 0 if (CGI::param('preview'));
    return 1;
}

Entries are written as normal, then they are viewed by adding ?preview=yes to the end of the URL. If am I happy with the entry, I put ?reindex=yes instead.

This method can also work with the wikieditish plugin too, by adding:

<input type="hidden" name="preview" value="yes" />

to the form in the foot.wikieditish file.



Please leave a comment permanent link
Keywords:  

Name:
URL/email (optional): (email address will not be displayed)
Comments: