-
- 372 Posts
I’m intrested in this too. I use the MetaTagExtra snippet which adds keywords. I have only just started to add keywords within MODx and noticed it adds <meta http-equiv="keywords"
I know I can just remove keywords from the snippet to avoid duplications, but is there anyway to stop MODx adding them instead?
-
- 1,611 Posts
BUMP!
I also want to remove this. I like my own META snippet better. Where is this code?
Personally I think that this should be completely removed from MODx. One of the best things about MODx is that it gives you complete control over your output. This feature - although undoubtedly useful for some people - flies in the face of that idea.
ZAP, Briggsy, et al... I agree. Silly, really... should be a module or plugin.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
- 1,611 Posts
I found the "offending" code in manager/includes/document.parser.class.inc.php. I just commented it out (see below). Alternatively you could alter it to meet your whims.
function mergeDocumentMETATags($template) {
/*
if($this->documentObject['haskeywords']==1) {
// insert keywords
$keywords = implode(", ",$this->getKeywords());
$metas = "\t<meta http-equiv=\"keywords\" content=\"$keywords\" />\n";
}
if($this->documentObject['hasmetatags']==1){
// insert meta tags
$tags = $this->getMETATags();
foreach ($tags as $n=>$col) {
$tag = strtolower($col['tag']);
$tagvalue = $col['tagvalue'];
$tagstyle = $col['http_equiv'] ? 'http_equiv':'name';
$metas.= "\t<meta $tagstyle=\"$tag\" content=\"$tagvalue\" />\n";
}
}
$template = preg_replace("/(<head>)/i", "\\1\n".$metas, $template);
*/
return $template;
}
I kind of like the idea of being able to add/alter meta tags from the document editor screen, but personally I would make it a snippet that interacts with the info entered there so that it’s easier to customize and streamline for efficiency.