Revision [14104]
This is an old revision of HTMLHandler made by BrianKoontz on 2006-05-05 23:33:03.
HTML Handler
See also:
Documentation: HTMHandlerInfo.This handler generates "standalone" HTML, without the header/footer/menu items.
Dependency
None.The code
Copy css/wikka.css to css/html.css, then add the following line to the top of html.css:Create handlers/page/html.php:
<?php
if ($this->HasAccess("read") && $this->page) {
// display page
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php echo $this->GetWakkaName().": ".$this->PageTitle(); ?></title>
<base href="<?php echo $site_base ?>" />
<?php if ($this->GetMethod() != 'show' || $this->page["latest"] == 'N' || $this->page["tag"] == 'SandBox') echo "<meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n"; ?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="<?php echo $this->GetConfigValue("meta_keywords") ?>" />
<meta name="description" content="<?php echo $this->GetConfigValue("meta_description") ?>" />
<style type="text/css">
<?php include("css/html.css") ?>
</style>
</head>
<body>
<?php
print($this->Format($this->page["body"], "wakka"));
}
?>
if ($this->HasAccess("read") && $this->page) {
// display page
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php echo $this->GetWakkaName().": ".$this->PageTitle(); ?></title>
<base href="<?php echo $site_base ?>" />
<?php if ($this->GetMethod() != 'show' || $this->page["latest"] == 'N' || $this->page["tag"] == 'SandBox') echo "<meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n"; ?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="<?php echo $this->GetConfigValue("meta_keywords") ?>" />
<meta name="description" content="<?php echo $this->GetConfigValue("meta_description") ?>" />
<style type="text/css">
<?php include("css/html.css") ?>
</style>
</head>
<body>
<?php
print($this->Format($this->page["body"], "wakka"));
}
?>
Add the following after about line 1109 in wikka.php (just before the final else statement):
elseif ($this->method == "html")
{
print($this->Method($this->method));
}
{
print($this->Method($this->method));
}
To Do
- Provide option to exclude inline CSS (with option to display listing of CSS to save in separate file)
- Provide "raw" html (no html, head, body tags)
- Clean up kludge in wikka.php (there should be no need to modify this file to accomodate a new handler type)
CategoryDevelopmentHandlers