iFrame in tt_news einbinden

50 Sprachen online kostenlos lernen - auch als APP

Einen iFrame-Tag in eine tt_news einbinden

Manchmal besteht eine News eben aus mehr als nur Text, Bild und Anhang. Ein besonders häufiger Fall ist sicherlich das einbinden eines YouTube-Videos als iFrame-Tag (HTML Code). Standardmäßig übernimmt der Editor einfach den Quellcode und gibt diesen aus. Sieht nicht schön aus und ist nicht das gewünschte Ergebnis.


Lösung:

Auf der root-Seite der Website geht man im Seiten-Modul auf die Seiteneigenschaften und hier im Reiter "Ressourcen" ins Feld "Seiten-TSConfig". Hier trägt man folgende Konfiguration ein.

RTE.default.proc.allowTags := addToList(iframe,embed,object,param)
RTE.default.proc.entryHTMLparser_db.allowTags := addToList(iframe,embed,object,param)
RTE.default.proc.allowTagsOutside := addToList(iframe,embed,object,param)
 
plugin.tt_news.displaySingle.content_stdWrap.parseFunc {
  nonTypoTagStdWrap.encapsLines.nonWrappedTag >
  allowTags = script, iframe, param, embed, object, a, abbr, acronym, address, blockquote, b, br, caption, center, cite, code, div, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, link, ol, p, pre, q, sdfield, span, strike, strong, sub, sup, table, thead, tbody, tfoot, td, th, tr, tt, u, ul
}
plugin.tt_news.general_stdWrap.parseFunc.allowTags := addToList(iframe,embed,object,param,p) 

Nun muss man noch im Template der root-Seite in den "Konstanten" folgenden Eintrag machen:

styles.content.links.allowTags = b,i,u,a,img,br,div,center,pre,font, hr,sub,sup,p,strong,em,li,ul,ol,blockquote,strike,del,ins,span, h1,h2,h3,h4,h5,h6,address,iframe,object,param,embed 

Obacht! Obiges muss alles in eine Zeile geschrieben sein - kein Umbruch!

Wenn man jetzt eine News anlegt, kann man den iFrame-Tag direkt in den Editor schreiben und bei der Ausgabe im Frontend erscheint der entsprechende Inhalt.