Seite 1 von 1
Ausgabe der Meta-Tags
Verfasst: Mo 22. Mai 2006, 11:59
von Damian
Hallo
Kann mir jedmand sagen wie ich in einem Modul die Meta-Tags eines jeweiliegen Artikels ausgeben kann?
Mit $article_id = $article->getField('idart'); geben ich die ID aus, geht das so auch mit den Meta-Tags?
Guss und Dank
Verfasst: Mo 22. Mai 2006, 12:23
von emergence
in der functions.con2.php findet man folgendes was eigentlich auch als modul funktionieren müsste
Code: Alles auswählen
<?php
$availableTags = conGetAvailableMetaTagTypes();
$metatags = array ();
foreach ($availableTags as $key => $value)
{
$metavalue = conGetMetaValue($idartlang, $key);
if (strlen($metavalue) > 0)
{
$metatags[] = array ($value["fieldname"] => $value["name"], 'content' => $metavalue);
}
}
// der teil zeigt einfach den array an...
echo "<pre>";
print_r($metatags);
echo "</pre>";
?>
Lösung
Verfasst: Mo 22. Mai 2006, 12:51
von Damian
Hallo
Hier nun meine Lösung:
Innerhalb eines Modules:
$article = $list->nextArticle();
$article_id = $article->getField('idart');
$article_idartlang = $article->getField('idartlang');
$metaauthor= conGetMetaValue($article_idartlang,1);
$metadate= conGetMetaValue($article_idartlang,2);
$metadescription= conGetMetaValue($article_idartlang,3);
Zahl hinten steht für Typ.
Typen:
1 author
2 date
3 description
4 expires
5 keywords
6 revisit-after
7 robots
Danach kann Wert in Template übergeben werden:
$tpl->set('d', 'META_Author', $metaauthor);
Gruss D
Verfasst: Mo 22. Mai 2006, 18:21
von HerrB
$list ist wie definiert?
Gruß
HerrB