[TYPO3-shop] list view suggestions + patch

Richard Hirner richard at hirner.at
Tue Mar 4 14:08:08 CET 2008


Hello,

I have two suggestion for the list view:

1) If the note is longer than max_note_length, don't split the words but 
cut at a word boundary.

2) Use strip_tags either for all or for none of the notes, but not only 
if the note is too long (that's ugly).

=> this works for me:

if (strlen($markerArray['###'.$itemTable->marker.'_NOTE###']) > $this->conf['max_note_length']) {
	$markerArray['###'.$itemTable->marker.'_NOTE###'] = strtok(wordwrap(strip_tags($markerArray['###'.$itemTable->marker.'_NOTE###']), $this->conf['max_note_length'], '|'), '|') . '...';
} else {
	$markerArray['###'.$itemTable->marker.'_NOTE###'] = strip_tags($markerArray['###'.$itemTable->marker.'_NOTE###']);
}

The wordwrap solution is not perfect because if the note contains '|', it will cut there.
Maybe this is wanted, in the other case one would have to use another special character
or a real function that cuts at word boundary instead of strtok & wordwrap.

-- 
Best regards,
Richard Hirner


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