Hi all,
I am trying to get my site to meet WAI Level AA for accessibility. I have one warning and one error from Cynthia Says (http://www.contentquality.com). The error is weird:
"Failure - Document does not contain a META element with the required name: language or language does not have a 'content' value."
Well, it does have such an element. Here it is:
<meta http-equiv="content-language" content="en"/>
This is provided by the $MetaTags variable. My question is, where does this come from? It seems to be from SiteTree.php in sapphire/core/model. But where does the current_lang() method referred here get its language string from. I ask because I want to check whether other values such as "en-GB" would make Cynthia Says notice the language META element. If anyone can suggest why CS might be failing on these apparently spurious grounds I would be grateful.
The second error is more problematic. It is about the search box at the top of my pages. That is provided by the code in Page.php (see end of this posting). Cynthia Says reports that the search form should have a label association:
"Rule: 12.4.1 - Identify all non-hidden INPUT elements that do not have an explicit LABEL association.
Failure - INPUT Element, of Type TEXT, at Line: 69, Column: 75 in FORM Element at Line: 65, Column: 6"
How do I modify the SearchForm() function to provide the form elements with labels that might satisfy Cynthia?
Thanks,
Ian.
--
############# Page.php code ###########
function SearchForm() {
$searchText = isset($_REQUEST['Search']) ? $_REQUEST['Search'] : 'Your search query:';
$fields = new FieldSet(
new TextField("Search", "", $searchText)
);
$actions = new FieldSet(
new FormAction('results', 'Search')
);
return new SearchForm($this, "SearchForm", $fields, $actions);
}