Skip to content

Instantly share code, notes, and snippets.

@mindmergedesign
Created April 23, 2013 19:05
Show Gist options
  • Save mindmergedesign/5446448 to your computer and use it in GitHub Desktop.
Save mindmergedesign/5446448 to your computer and use it in GitHub Desktop.
Omega Sub-Theme Doctype
/**
* Implements hook_preprocess_html().
**/
function YOURTHEMENAME_preprocess_html(&$vars) {
$vars['doctype'] = '<!DOCTYPE html>' . "\n";
$vars['rdf'] = new stdClass;
$vars['rdf']->version = '';
$vars['rdf']->namespaces = '';
$vars['rdf']->profile = '';
// Serialize RDF Namespaces into an RDFa 1.1 prefix attribute.
if ($vars['rdf_namespaces']) {
$prefixes = array();
foreach (explode("\n ", ltrim($vars['rdf_namespaces'])) as $namespace) {
// Remove xlmns: and ending quote and fix prefix formatting.
$prefixes[] = str_replace('="', ': ', substr($namespace, 6, -1));
}
$vars['rdf']->namespaces = ' prefix="' . implode(' ', $prefixes) . '"';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment