Hi Christoph,
There is another important part to microdata it itemprop="headline" for page titles h1-h7.
For page description required attributes itemprop="description" itemprop="keywords" - these attributes are not valid in combination with name="description" name="keywords" but better attendance than the validity of the pages!
Tell me where to add attributes in the code CMSimple_XH?
Doctype in Templates
Re: Doctype in Templates
Christoph,
How to add attributes to:
<meta itemprop="description" name="description" content="blabla" />
<meta itemprop="keywords" name="keywords" content="blabla" />
<h1 itemprop="headline">title page</h1>
<h2 itemprop="headline">title page</h2>
...
?
How to add attributes to:
<meta itemprop="description" name="description" content="blabla" />
<meta itemprop="keywords" name="keywords" content="blabla" />
<h1 itemprop="headline">title page</h1>
<h2 itemprop="headline">title page</h2>
...
?
Re: Doctype in Templates
Change function meta() in cmsimple/functions.php to:Termin wrote:<meta itemprop="description" name="description" content="blabla" />
<meta itemprop="keywords" name="keywords" content="blabla" />
Code: Select all
function meta($n)
{
global $cf, $tx, $print;
$exclude = array('robots', 'keywords', 'description');
$value = isset($tx['meta'][$n]) ? $tx['meta'][$n] : $cf['meta'][$n];
if ($n != 'codepage' && !empty($value) && !($print && in_array($n, $exclude))) {
$content = XH_hsc($value);
if (in_array($n, array('keywords', 'description'))) {
return tag('meta itemprop="' . $n . '" name="' . $n . '" content="' . $content . '"') . "\n";
} else {
return tag('meta name="' . $n . '" content="' . $content . '"') . "\n";
}
}
}
Change function content() in cmsimple/tplfuncs.php to:Termin wrote:<h1 itemprop="headline">title page</h1>
<h2 itemprop="headline">title page</h2>
Code: Select all
function content()
{
global $s, $o, $c, $edit, $cf;
if (!($edit && XH_ADM) && $s > -1) {
if (isset($_GET['search'])) {
$search = XH_hsc(stsl($_GET['search']));
$words = explode(' ', $search);
$c[$s] = XH_highlightSearchWords($words, $c[$s]);
}
$c[$s] = preg_replace(
'/<h([1-' . $cf['menu']['levels'] . '])([^>]*)>/',
'<h$1$2 itemprop="headline">',
$c[$s]
);
return $o . preg_replace('/#CMSimple (.*?)#/is', '', $c[$s]);
} else {
return $o;
}
}
Christoph M. Becker – Plugins for CMSimple_XH
Re: Doctype in Templates
Cool thank you Christoph.
---------------------------------
I did a search with the addition of the keyboard controls and added role. id it does not need a search form in css you can define div="search" + form.
---------------------------------
I did a search with the addition of the keyboard controls and added role. id it does not need a search form in css you can define div="search" + form.
Code: Select all
function my_searchbox()
{
global $sn, $tx;
return '<form action="' . $sn . '" method="get">' . "\n"
. '' . "\n"
. tag(
'input type="search" name="search" accesskey="f" title="'
. $tx['search']['label'] . '"'
) . "\n"
. tag('input type="hidden" name="function" value="search"') . "\n" . ' '
. tag(
'input type="submit" value="'
. $tx['search']['button'] . '"'
) . "\n"
. '' . "\n" . '</form>' . "\n";
}