Bug #53214
closedTypoScript noTrimWrap Bug in FILES
0%
Description
If you want to use noTrimWrap somewhere inside of a FILES cObject, it wont work correct.
The first item (file) is trimmed at the end (but shouldn't).
From the second item to the last the noTrimWrap is missing at all (spaces and letters).
Btw: It doesn't matter if you use a static file (like in my example) or file.import...
To reproduce the following code, prepare some jpg-file in this folder: /fileadmin/gallery/
One Picture should have the name A_Desert.jpg (you can also adjust the filename in typoscript above).
------------------------------
Test 1) Regular working example
Output: aaa - bbb
page = PAGE page { 10 = TEXT 10.*value = aaa* 20 = TEXT 20.*value = bbb* 20.*noTrimWrap = | - ||* }
------------------------------
Test 2) Bug with noTrimWrap
Output first Image (space missing): aaa -bbb
Output of following Images (complete noTrimWrap missing): aaabbb
page = PAGE page { 20 = FILES 20 { folders = 1:gallery/ renderObj = COA renderObj { 10 = TEXT 10.*value = aaa* 20 = TEXT 20.*value = bbb* 20.*noTrimWrap = | - ||* } } }
------------------------------
Test 3) The Position of the noTrimWrap doesn't matter. The Problem appears always. Here is an other Example.
Output first Image: <a href="index.php?id=1" title="*aaa x-ybbb*"><img src="fileadmin/gallery/A_Desert.jpg" width="1024" height="768" border="0" alt=""></a>
Output of following Images: <a href="index.php?id=1" title="*aaabbb*"><img src="fileadmin/gallery/A_Desert.jpg" width="1024" height="768" border="0" alt=""></a>
page = PAGE page { 20 = FILES 20 { folders = 1:gallery/ renderObj = COA renderObj { 10 = IMAGE 10 { file = fileadmin/gallery/A_Desert.jpg stdWrap.typolink.parameter = 1 stdWrap.typolink.ATagParams.cObject = COA stdWrap.typolink.ATagParams.cObject { 30 = COA 30 { stdWrap.noTrimWrap= | title="|" | 10 = TEXT 10.*value = aaa* 20 = TEXT 20.*value = bbb* 20.*noTrimWrap = | x-y ||* } } } } } }
Files
Updated by Gernot Ploiner over 10 years ago
- File typoscript.txt typoscript.txt added
Added TypoScript as attachement.
Updated by Stefan Froemken over 10 years ago
I can reproduce this problem. But it is not a problem of renderObj. It's more a problem of splitConfArray. It can work with optionSplit and searches for || and |*|. In your example you have such a part in noTrimWrap. That's why this information gets lost.
Updated by Gernot Ploiner over 10 years ago
Its not a Bug, its a Feature ;-)
The solution is to use spaces everywhere:
noTrimWrap = | - | |
and not:
noTrimWrap = | - ||
A hint in TSREF at renderObj would be great:
Be careful with noTrimWrap, because of the OptionSplit function. Never use || without spaces! OptionSplit comes first.
(My english is not the best, so feel free to modify my Text ;-)
Thank you and close this Ticket please.
Updated by Gerrit Code Review over 10 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/25063
Updated by Stefan Froemken over 10 years ago
I have created a patch for it. This patch excludes noTrimWrap from optionSplit. The other option is to remove optionSlit from FILES-cObject. Your solution append an additional Space behind. In HTML this is visible as one space, but in Sourcecode you have two spaces.
Updated by Stefan Froemken over 10 years ago
Dmitry meens it's better to work with splitChar:
page.1 = FILES page.1 { folders = 1:user_upload/images/examples/ sorting = date sorting.direction = ASC renderObj = COA renderObj { 10 = TEXT 10.value = aaa 20 = TEXT 20.value = bbb 20.noTrimWrap = $ - $$ 20.noTrimWrap.splitChar = $ } }
In my opinion this needs to be extra documented.
Stefan
Updated by Stefan Froemken over 10 years ago
I have created a new issue for Documentation-Team and set it as relation. So this is a "solved-by-docu"-issue.
You can close this ticket now.
Stefan
Updated by Gernot Ploiner over 10 years ago
The same Problem appears on the stdWrap function .split in combination with .cObjectNum or CONTENT/RECORDS and so on. Perhaps in some other constellations too?
So it is a general TypoScript Problem. It doesn't depend on the new FILES cObject.
The splitChar Solution is great. But you are right: Its hard to find out. But where should it be documented because it doensn't depend on FILES?
Updated by Sascha Egerer over 10 years ago
That is already documented in tsref. http://docs.typo3.org/typo3cms/TyposcriptReference/latest/Functions/Stdwrap/Index.html#stdwrap-notrimwrap
Updated by Gernot Ploiner over 10 years ago
thank you, good work.
you can close this ticket.
Updated by Chris topher over 10 years ago
- Status changed from Under Review to Closed
- Target version deleted (
next-patchlevel)
Closed as requested.