|
|
How to crop texts preserving whole words and strip HTMLIf you need to crop a text to a certain length, also make the crop preserve whole words and strip HTML you can do this from your TYPO3 extension in the following manner:
$short=$this->cObj->stdWrap($row['bodytext'], array('crop' => '200|...|1', 'stripHtml'=>1));
The magic that does this is $this->cObj->stdWrap where the first parameter is the string and the second one the configuration array for the crop and strip html. General aspects : | TYPO3 | TYPO3 Installation | TYPO3 Configuration | TYPO Administration | TYPO3 Performance |TYPO3 Troubleshooting | TYPO3 Glossary | Development : | Typoscript | TYPO3 Extensions - TER | TYPO3 API | TYPO3 Extension Development | Extbase | Fluid? | 3rd party | Back to > CMS |
Google SearchLogin |