[TYPO3-ttnews] Rendering additional rich text field

Oliver Rowlands oliver at liquidlight.co.uk
Tue Mar 20 23:28:18 CET 2007


Hi Matthias,

Try the following extraItemMarkerHook class:

class tx_ttnews_myExtraItemMarkerHook {

function extraItemMarkerProcessor($markerArray, $row, $lConf, &$pObj) {
		
     if(isset($row['uid'])) {

       $markerArray['###TEXTFELD###'] = '';

       if(isset($row['user_textfeld']) && 
strlen(trim($row['user_textfeld'])) > 0) {
         $markerArray['###TEXTFELD###'] .= 
$pObj->formatStr($pObj->local_cObj->stdWrap($row['user_textfeld'], 
$lConf['content_stdWrap.']));
       }
			
     }
		
     return $markerArray;
		
   }

}

Then add the following to your localconf.php

require_once([PATH TO CLASS].'class.tx_ttnews_myExtraItemMarkerHook.php');
$TYPO3_CONF_VARS['EXTCONF']['tt_news']['extraItemMarkerHook'][] = 
'tx_ttnews_myExtraItemMarkerHook';

Let me know how you get on.

Best regards,

Oliver

Matthias Kurz wrote:
> Hi Oliver,
> 
> thanks for your help. Now I get a "Call to a member function on a 
> non-object" - apparently I can't call either the formatStr-function or 
> the stdWrap-function.
> Any idea?
> Thanks again, Matthias
> 
> 
> Oliver Rowlands schrieb:
>> Hi Matthias,
>>
>> Try this:
>>
>> $markerArray['###TEXTFELD###'] = '';
>>
>> if ($row['user_textfeld'] != '') {
>>   $markerArray['###TEXTFELD###'] .= 
>> $this->formatStr($pObj->local_cObj->stdWrap($row['user_textfeld'], 
>> $lConf['content_stdWrap.']));
>> } else {
>>   $markerArray['###TEXTFELD###'] = '';
>> }
>>
>> Hope this helps,
>>
>> Oliver
>>
>> Matthias Kurz wrote:
>>> Hi list,
>>> I am sure it is no big deal, but I am to blind to see it. I added 
>>> some addional fields via "example_itemMarkerArrayFunc.php". 
>>> Everything works fine, only the Rich Text output is not rendered 
>>> properly: Links are not redered with a-tag and there are no p-tags.
>>> My code:
>>> $markerArray['###TEXTFELD###'] = '';
>>>         if ($row['user_textfeld']!='') {
>>>         // fills the marker
>>>         $markerArray['###TEXTFELD###'] .=$row['user_textfeld'];
>>>     } else { // empty
>>>         $markerArray['###TEXTFELD###']='';
>>>     }
>>>
>>> Where is my mistake?
>>>
>>> Thanks in advance, Matthias
>>
>>


-- 
Oliver Rowlands
:: Liquid Light ::

E - oliver at liquidlight.co.uk
W - http://www.liquidlight.co.uk

T - 00 44 (0)845 6 58 88 35
F - 00 44 (0)845 6 58 44 35


More information about the TYPO3-project-tt-news mailing list