Difference between revisions of "S2 Cookbook: A Testbed Layout"

From Dreamwidth Notes
Jump to: navigation, search
m (S2 Testbed Layout)
m
Line 1: Line 1:
This layout is meant to give you a clean testbed to explore examples with.  It gives ONLY the barest basics to get a blank HTML page to load, ensuring your test code is at the forefront of attention.  It is NOT a good start to creating a new layout--it's missing key information a functional layout needs.  For examples about making layouts, please see [[S2 Cookbook: Converting a CSS design to a layout]].
+
This layout is meant to give you a clean testbed to explore S2 examples with.  It gives ONLY the barest basics to get a blank HTML page to load, ensuring your test code is at the forefront of attention.  It is NOT a good start to creating a new layout--it's missing key information a functional layout needs.  For examples about making layouts, please see [[S2 Cookbook: Converting a CSS design to a layout]].
  
 
To use it, make a new layout layer containing the code below, and then a style that uses that layout.  If you need more information on how to do that, please see [[S2_Guide:_Style_System_Overview#Creating_and_managing_layers| S2 Guide: Style System Overview: Creating and managing layers]], as well as the section on creating and managing styles.
 
To use it, make a new layout layer containing the code below, and then a style that uses that layout.  If you need more information on how to do that, please see [[S2_Guide:_Style_System_Overview#Creating_and_managing_layers| S2 Guide: Style System Overview: Creating and managing layers]], as well as the section on creating and managing styles.

Revision as of 21:52, 10 July 2010

This layout is meant to give you a clean testbed to explore S2 examples with. It gives ONLY the barest basics to get a blank HTML page to load, ensuring your test code is at the forefront of attention. It is NOT a good start to creating a new layout--it's missing key information a functional layout needs. For examples about making layouts, please see S2 Cookbook: Converting a CSS design to a layout.

To use it, make a new layout layer containing the code below, and then a style that uses that layout. If you need more information on how to do that, please see S2 Guide: Style System Overview: Creating and managing layers, as well as the section on creating and managing styles.

S2 Testbed Layout

layerinfo "type" = "layout";
layerinfo "name" = "S2 Testbed Layout";
 
function Page::print()
"This is a skeleton page function, for testing."
{
    """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" """;
    """"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n""";
    """<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n""";
    """<head>\n""";
    """<title>S2 Testbed Layout</title>\n""";
    """</head>\n""";
    """<body>\n""";
 
    # Code you want to test goes here
    
    """</body>\n""";
    """</html>\n""";
}