Project

General

Profile

Actions

Feature #31969

closed

cropHTML, dynamic max number of chars

Added by Daniel Mannheimer almost 13 years ago. Updated 5 months ago.

Status:
Rejected
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 #1

Updated by Mathias Schreiber almost 10 years ago

  • Category set to TypoScript
  • Status changed from New to Accepted
  • Target version set to 7.0
  • PHP Version set to 5.5

Might need some additional testing if the value transmitted s a variable but apart from that... nice addition

Actions #2

Updated by Mathias Schreiber almost 10 years ago

  • Target version changed from 7.0 to 7.1 (Cleanup)
Actions #3

Updated by Benni Mack over 9 years ago

  • Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
Actions #4

Updated by Susanne Moog over 9 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #5

Updated by Benni Mack about 9 years ago

  • Target version changed from 7.5 to 8 LTS
Actions #6

Updated by Riccardo De Contardi over 7 years ago

  • Target version changed from 8 LTS to 9.0
Actions #7

Updated by Susanne Moog almost 7 years ago

  • Target version changed from 9.0 to 9 LTS
Actions #8

Updated by Susanne Moog about 6 years ago

  • Target version changed from 9 LTS to Candidate for Major Version
Actions #9

Updated by Susanne Moog over 2 years ago

  • Sprint Focus set to On Location Sprint
Actions #10

Updated by Oliver Hader about 2 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions #11

Updated by Benni Mack 5 months ago

  • Status changed from Accepted to Rejected

Hi Daniel,

unfortunately, as statistics show us -- people don't use TypoScript for more sophisticated parts anymore - either they use custom data processors, or they just a Fluid ViewHelper. I recommend doing this as well, as - after all these years - looks like we don't find anymore adding this feature and find a valid use-case (nowadays) for it.

I hope this is OK for you! Sorry for keeping you waiting for so long.

Actions

Also available in: Atom PDF