Hallo Leute,
weiss jemand, wie ich bei den News in der Single-Ansicht die Stichworte als Keywords in die Metatags bekomme?
Sachdienliche Hinweise sind willkommen!
Lieben Gruss
Michael
Hallo Leute,
weiss jemand, wie ich bei den News in der Single-Ansicht die Stichworte als Keywords in die Metatags bekomme?
Sachdienliche Hinweise sind willkommen!
Lieben Gruss
Michael
Könnte sowas gerade jetzt auch gebrauchen!
Wurde irgendeine Lösung gefunden?
Bisher leider nicht 🙁 Aber ich suche weiter...
Ich habe sogar schon ernsthaft in Erwägung gezogen, PHP dafür zu lernen...
Lieben Gruss
Michael
Habe mir mal eine schnelle Lösung gebaut:
1. Habe ich mir die Datei meta.php aus dem Ordner typo3/etx/metatags in meine fileadmin-Struktur kopiert und dort meta.inc genannt.
2. Dann habe ich den Code in der Datei angepasst
$localDescription = trim($this->stdWrap($local['description'],$local['description.']));
$localKeywords = trim($this->stdWrap($local['keywords'],$local['keywords.']));
// ab hier neuer Inhalt
$arrNews=t3lib_div::_GET('tx_ttnews');
$newsID = intval($arrNews['tt_news']);
if ($newsID>0){
// fetch the News Infos
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'title,short,keywords',
'tt_news',
'uid='.$newsID,
'',
'',
'1');
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$localKeywords.= trim(htmlspecialchars$row['keywords']));
$localDescription.= trim(htmlspecialchars($row['title']));
$localDescription.= trim(htmlspecialchars($row['short']));
}
}
//hier geht es normal weiter
// Unsetting secondary description and keywords if constant is not substituted!
3. Und dann noch im TS Setup folgendes eingetragen
plugin.meta{
// Verweis auf die neue Datei
file = fileadmin/meta.inc
flags.DC = 1
}
seite.headerData.999 < plugin.meta
Das war's!
Ach ja, ich habe nicht nur die Keywords aus der News aufgenommen, sondern auch noch den Titel und den Untertitel-Text, damit ich was für die Beschreibung habe! Aber das ist ja Geschmackssache!
Getestet unter Typo3 Vers. 3.7!
Cooooooool!
Und damit hast du wieder bewiesen, dass es verdammt viel Sinn macht, dass ich PHP lerne 😉
Lieben Gruss und Danke,
Michael
Und schon ein Nachtrag:
Jetzt hat Rupert eine neue Version von tt_news erstellt, die das gleich macht 😉
Lieben Gruss
Michael
Welche Version von tt_news meinst Du, und was kann man da einstellen?
So, da die Version noch nicht im Repository ist, habe ich mal den Text aus der Mailing-List hier reinkopiert:
Rupert German/ tt_news-Mailinglist schriebhi,
I uploaded these changes to the tt_news cvs project:
- new XML-feed formats: rdf and atom03. A big thank goes to ingo renner who
sent me patches and an updated manual.
- removed the wrong default values from autoinc lines in tables.sql
- added the possibility to render the content of the keywords field to a
template marker (###NEWS_KEYWORDS###)
- small field re-arrangement in tca.php to reduce the width of the tt_news
BE form.
- updated the manual with some of the new features (not complete)- added two new registers "newsSubheader" and "newsKeywords" which are set
in the news singleView. this allows you to insert those values f.e. as
metatagsExample:
# plugin.meta is configured to fill its contents to page.headerData.999
# this will insert the values from the fields keywords and subheader to
# the meta tags keywords and description
page.headerData.999 {
local >
local {
description.data = register:newsSubheader
keywords.data = register:newsKeywords
}
}
Gruss
Michael