17.7.1 Cheetah.Templates.SkeletonPage

A stock template class that may be useful for web developers is defined in the Cheetah.Templates.SkeletonPage module. The SkeletonPage template class is generated from the following Cheetah source code:

##doc-module: A Skeleton HTML page template, that provides basic structure and utility methods.
################################################################################
#extends Cheetah.Templates._SkeletonPage
#implements respond
################################################################################
#cache id='header'
$docType
$htmlTag
<!-- This document was autogenerated by Cheetah(http://CheetahTemplate.org). 
Do not edit it directly!

Copyright $currentYr - $siteCopyrightName - All Rights Reserved.
Feel free to copy any javascript or html you like on this site,
provided you remove all links and/or references to $siteDomainName
However, please do not copy any content or images without permission.

$siteCredits

-->


#block writeHeadTag
<head>
<title>$title</title>
$metaTags 
$stylesheetTags 
$javascriptTags
</head>
#end block writeHeadTag

#end cache header
#################

$bodyTag

#block writeBody
This skeleton page has no flesh. Its body needs to be implemented.
#end block writeBody

</body>
</html>

You can redefine any of the blocks defined in this template by writing a new template that #extends SkeletonPage. (As you remember, using #extends makes your template implement the .writeBody() method instead of .respond() - which happens to be the same method SkeletonPage expects the page content to be (note the writeBody block in SkeletonPage).)

#def bodyContents
Here's my new body. I've got some flesh on my bones now.
#end def bodyContents

All of the $placeholders used in the SkeletonPage template definition are attributes or methods of the SkeletonPage class. You can reimplement them as you wish in your subclass. Please read the source code of the file src/Templates/_SkeletonPage.py before doing so.

You'll need to understand how to use the following methods of the SkeletonPage class: $metaTags(), $stylesheetTags(), $javascriptTags(), and $bodyTag(). They take the data you define in various attributes and renders them into HTML tags.

The class also provides some convenience methods that can be used as $placeholders in your template definitions: