Project

General

Profile

Actions

Feature #31969

open

cropHTML, dynamic max number of chars

Added by Daniel Mannheimer over 12 years ago. Updated over 1 year ago.

Status:
Accepted
Priority:
Could have
Assignee:
-
Category:
TypoScript
Start date:
2011-11-21
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.5
Tags:
Complexity:
Sprint Focus:

Description

It would be nice if cropHTML (and crop) could handle variables as first parameter inside $options. Would take just one additional line of code in root/typo3/sysext/cms/tslib/class.tslib_content.php:

    function cropHTML($content, $options) {
        $options = explode('|', $options);
        // added next line to process $options[0] with insertData and so be able to use variables for cropping length
        $options[0] = $this->insertData($options[0]);        
        $chars = intval($options[0]);

So one could use constants or register values to pass to cropHTML like
tt_content.text.20.cropHTML = {$contentCropLength} | ... | 1
tt_content.text.20.insertData = 1
or
tt_content.text.20.cropHTML = {register:croplength} | ... | 1
tt_content.text.20.insertData = 1

Actions

Also available in: Atom PDF