Task #92505

Fix example for format.crop

Added by Sybille Peters about 2 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Documentation
Target version:
-
Start date:
2020-10-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

https://docs.typo3.org/other/typo3/view-helper-reference/9.5/en-us/typo3/fluid/latest/Format/Crop.html

Has this (first) example:

<f:format.crop maxCharacters="10">
    This is some very long text
</f:format.crop>

This is not a good example because it does not explain how it crops. You are left wondering if it counts the whitespace. Or why else the result is "This is" and not "This is so" (for maxCharacters="10").

Lower down on the page you see the respectWordBoundaries.

So it counts the whitespace and it stops if an entire word does not fit.

If the indenting style is changed, the output changes too. In any case, the whitespace makes it unnecessarily confusing.

Alternatively, it might be good to point out that whitespace is not trimmed away.

Maybe change it to this:

<f:format.crop maxCharacters="10">This is some very long text</f:format.crop>

Add the information about word boundary to first example.

And add a tip how to trim the whitespace.

#1

Updated by Gerrit Code Review about 1 month ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66155

#2

Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66155

#3

Updated by Gerrit Code Review about 1 month ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66127

#4

Updated by Sybille Peters about 1 month ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF