Geoff Richards > Daizu-0.3 > preview.cgi

Download:
Daizu-0.3.tar.gz

Annotate this POD

Website

CPAN RT

Open  0
Report a bug
Source  

NAME ^

preview.cgi - dynamic preview of Daizu output

DESCRIPTION ^

The cgi/preview.cgi script distributed with Daizu generates content using Daizu generator classes in exactly the same way as it would be if you were publishing it, and then presents it to your browser. However, for HTML and CSS content it also adjusts any links it can find to point to the preview versions of them, so you can use it to look at a whole website as it will appear when published.

Currently this makes it useful for testing changes to templates, but not much else. It will be a lot more useful when Daizu allows content to be edited in the database.

To use it, set up Apache to run CGI scripts and make sure that the script can find the Daizu configuration file and Daizu libraries. You might need to add some settings to the Apache configuration like this:

   SetEnv PERL5LIB /.../Daizu/lib
   SetEnv DAIZU_CONFIG /.../config.xml

Once it's up and running you should be able to load preview.cgi in your browser, without any arguments. It will try to find and URLs which look like the homepages of websites, and give you links to them so that you can start testing your site.

If you request a preview of a URL which would be a redirect or is marked 'gone', then this script will show you information about the URL rather than actually redirecting you.

PARAMETERS ^

This CGI script accepts two parameters in its query string, which you can adjust by hand if necessary:

url

The full URL of the page (or other file) you wish to preview. Without this the script will show you an introductory page.

wc

The ID number of the working copy you wish to preview content from. You can set this by hand if you want to preview a working copy on a branch (if you're making large-scale changes to your site and want to keep the changes from going live until they're all finished).

Defaults to the live working copy.

If not the default value then the value will be preserved in any links you follow on the pages you're previewing.

COPYRIGHT ^

This software is copyright 2006 Geoff Richards <geoff@laxan.com>. For licensing information see this page:

http://www.daizucms.org/license/