Home

WebsiteBaker & XHTML Strict

WebsiteBaker already produces decent code if you use the AllCSS Template, or create your own. If you'd like it to spit out XHTML Strict, instead of Transitional, you need to get it to stop using the target attribute in its menu routines.

The notes below refer to WebsiteBaker 2.6.5, but apply to other versions. Even if details of the operation are different, the principle is the same.

First amend framework/class.frontend.php, changing (line 355 in WB 2.6.5):

// Create values
$values = array($class,'<a href="'.$link.'" target="'.$page['target'].'" '.$class.'>', '</a>', htmlentities($page['menu_title']), htmlentities($page['page_title']));

to:

// Create values
$values = array($class,'<a href="'.$link.'" '.$class.'>', '</a>', htmlentities($page['menu_title']), htmlentities($page['page_title']));

Note that the page_menu() function in 2.6.5 produces invalid code (incorrectly nested lists) under some circumstances - I use show_menu2() in preference.

When you've done that, change the DOCTYPE in the template's index.php file to:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

All this assumes, obviously, that the rest of your code conforms to XHTML 1.0 Strict; check it using the W3C validator.