TIP: 8
Title: Modification of default-master.adp structure.
Version: 0.1d
Authors: Andrei Popov (andrei::at::ceesaxp::dot::org)
State: Draft
Type: Process
Vote:
Created: Saturday, August 23, 2003
-------------------------------------------------------
Abstract
To make OpenACS more standards-compliant it should move away from using tables as a layout engine. The first small step in this direction would be to modify default-master.adp to explicitly state master/slave DIVs.
Rationale
OpenACS-HEAD advertises itself (in default installation, based on content of default-master.adp) as <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">. Anybody attempting to validate even the front page of default installation will immediately discover that resulting document does not validate against the a.m. DOCTYPE.
While making OpenACS as compliant with current Web Standards is beyond the purpose of this TIP, it is suggested that several small changes could lay the foundation to future modifications of the core make it compliant.
One of the problems one faces trying to abolish TABLE-based design in favor of a DIV-based is correct positioning of resulting elements. Mixing DIV'ed and not DIV'ed content within the same page results in a complete mess. However, by wrapping portions of default-master in separate DIVs and assigning a sensible positioning CSS to them eliminates this problem.
Proposed Modifications
default-master.adp should be modified to include thre wrapper DIVs ID'ed as: master-top, slave, master-bottom. Using ID atribute of DIV tag is proposed in order to enforce uniqueness of an element.
In order to ensure correct positioning of resulting DIVs, it is then suggested to embed CSS block within default-master (via LINK), that defines properties of a.m. DIVs.
A sample default-master.adp could, therefore, look thusly:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>@title@</title>
@header_stuff@
<style type="text/css">
#master-top {
}
#master-bottom {
float:left;
}
#slave {
}
</style>
</head>
<body<multiple name=attribute>@attribute.key@="@attribute.value@"</multiple>>
<div id="master-top">
<include src="login-status" />
<if @body_start_include@ not nil>
<include src="@body_start_include@" />
</if>
<h1>@title@</h1>
@context_bar@
<hr />
</div>
<div id="slave">
<slave />
</div>
<div id="master-bottom">
<hr />
<address><a href="mailto:@signatory@">@signatory@</a></address>
@ds_link@
</div>
</body>
</html>
Request notifications