Zum Inhalt springen

Bildunterschrift mit RTE

Erstellt am 2. Juli 2012 · 5 Antworten · letzte Antwort am 3. Juli 2012

Tags: Frage

cooper ·

Hallo,

folgendes Problem. Ich möchte das bei tt_news das Feld der Bildunterschriften als RTE dargestellt und ebenfalls im Frontend so formatiert ausgegeben wird. Ergoogelt habe ich mir das hier für die Subheadline:

t3lib_div::loadTCA('tt_news');
$GLOBALS['TCA']['tt_news']['columns']['short']['config']['softref'] = 'typolink_tag,images,email[subst],url';
$GLOBALS['TCA']['tt_news']['columns']['short']['config']['wizards'] = array(
	'_PADDING' => 4,
	'RTE' => array(
		'notNewRecords' => 1,
		'RTEonly' => 1,
		'type' => 'script',
		'title' => 'LLL:EXT:lang/locallang_general.php:LGL.subheader',
		'icon' => 'wizard_rte2.gif',
		'script' => 'wizard_rte.php',
	),
);
foreach($GLOBALS['TCA']['tt_news']['types'] as $index => $conf) {
	$GLOBALS['TCA']['tt_news']['types'][$index]['showitem'] = preg_replace('/short([.^,])*,/', 'short;;;richtext:rte_transform[flag=rte_enabled|mode=ts];4-4-4,', $GLOBALS['TCA']['tt_news']['types'][$index]['showitem']);
}

Leider krieg ich das nicht auf die Kette das so anzupassen, es auf die Bildunterschrift anzuwenden. Kann mir hier irgendjemand helfen.

#angry#

LuP ·

Hallo,

alle Vorkommnisse des Feldes short durch imagecaption ersetzen. Dann regex noch anpassen.

VG,
LuP

cooper ·

Danke dir LuP.

Mit RegEx steh ich auf dem Kriegsfuß. Die können mich nicht leiden. Was muss da angepasst werden?

Gruß...

cooper ·

Try and error scheint geholfen zu haben...

Der RTE wird angezeigt, aber ob das TCA noch so in Ordnung ist sei dahin gestellt #paralyzed#

t3lib_div::loadTCA('tt_news');
$GLOBALS['TCA']['tt_news']['columns']['imagecaption']['config']['softref'] = 'typolink_tag,images,email[subst],url';
$GLOBALS['TCA']['tt_news']['columns']['imagecaption']['config']['wizards'] = array(
	'_PADDING' => 4,
	'RTE' => array(
		'notNewRecords' => 1,
		'RTEonly' => 1,
		'type' => 'script',
		'title' => 'LLL:EXT:lang/locallang_general.php:LGL.subheader',
		'icon' => 'wizard_rte2.gif',
		'script' => 'wizard_rte.php',
	),
);
foreach($GLOBALS['TCA']['tt_news']['types'] as $index => $conf) {
	$GLOBALS['TCA']['tt_news']['types'][$index]['showitem'] = preg_replace('/imagecaption([.^,])*;/', 'imagecaption;;;richtext:rte_transform[flag=rte_enabled|mode=ts];4-4-4', $GLOBALS['TCA']['tt_news']['types'][$index]['showitem']);
}
LuP ·

eher

'/imagecaption([.^;5])*,/'

(subset that matches one of set of any characters with ; at the beginning, 5 and preceding ,)

würde ich sagen.

VG,
LuP

cooper ·

Großartig! Danke dir.

Der komplette Teil für alle die das auch noch mal suchen sollten:

t3lib_div::loadTCA('tt_news');
$GLOBALS['TCA']['tt_news']['columns']['imagecaption']['config']['softref'] = 'typolink_tag,images,email[subst],url';
$GLOBALS['TCA']['tt_news']['columns']['imagecaption']['config']['wizards'] = array(
	'_PADDING' => 4,
	'RTE' => array(
		'notNewRecords' => 1,
		'RTEonly' => 1,
		'type' => 'script',
		'title' => 'LLL:EXT:lang/locallang_general.php:LGL.subheader',
		'icon' => 'wizard_rte2.gif',
		'script' => 'wizard_rte.php',
	),
);
foreach($GLOBALS['TCA']['tt_news']['types'] as $index => $conf) {
	$GLOBALS['TCA']['tt_news']['types'][$index]['showitem'] = preg_replace('/imagecaption([.^;5])*,/', 'imagecaption;;;richtext:rte_transform[flag=rte_enabled|mode=ts];4-4-4', $GLOBALS['TCA']['tt_news']['types'][$index]['showitem']);
}