#67669noTrimWrap not working with optionSplit
Description
I’ve used noTrimWrap in a TMENU together with optionSplit. It worked fine in TYPO3 4.5 but failed after upgrading to 6.2. It turns out to be caused by #20793, which itself aims to be a bugfix. Regression here?
Reviews 1
Related issues 1
History 11
-
Jigal van Hemert commented and changed status
NewNeeds Feedback 06/29/15, 10:38 -
Stefan Neufeind commented 06/29/15, 11:13
Code that worked fine with a TMENU-rootline-menu on 4.5 is:
stdWrap.noTrimWrap = | |*| | > |Since it didn’t work on 6.2 anymore for the moment I’ve switched to just “wrap” with optionsplit. As is obvious the spaces needed to become or so then, but it worked fine with wrap instead of noTrimWrap. And it turns out the patch I mentioned caused/causes the problem.
-
Alexander Opitz changed status
Needs FeedbackNew 09/28/15, 15:30 -
Jigal van Hemert commented 09/28/15, 21:11
Stefan Neufeind wrote:
> Code that worked fine with a TMENU-rootline-menu on 4.5 is:
>
> stdWrap.noTrimWrap = | |*| | > |
>
> Since it didn’t work on 6.2 anymore for the moment I’ve switched to just “wrap” with optionsplit. As is obvious the spaces needed to become or so then, but it worked fine with wrap instead of noTrimWrap. And it turns out the patch I mentioned caused/causes the problem.OptionSplit takes precedence, so the |*| will turn this into:
first = |
middle = | > |I’m not surprised that both values will not do what you expect.
In 6.1 and higher you can define a different split character for noTrimWrap and let optionSplit use the usual || and |*| combinations.
Since you mention a rootline menu I guess you want to prefix the second and following items with a ‘>’.noTrimWrap = ^^^ |*| ^ > ^^ noTrimWrap.splitChar = ^
This would use the ‘^’ as the split character for the noTrimWrap, while optionSplit uses the |*|
This is documented in the TSreference:
https://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Stdwrap/Index.html#notrimwrap -
Riccardo De Contardi commented and changed status
NewNeeds Feedback assigned to Stefan Neufeind 11/25/16, 12:13Hi Stefan,
the behavior reported by Jigal is indeed documented since 6.2; do you think it is sufficient to close this issue? Could you test it? Thank you! -
Alexander Opitz commented and changed status
Needs FeedbackClosed removed the assignee 04/28/17, 12:11No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.
-
Rémy DANIEL commented 12/16/19, 17:13
TYPO3 9.5
I am trying to use noTrimWrap with option split, without success.
You can reproduce it with that piece of TypoScript.
You should have a page tree with at least 3 levels, and viewing a page on the 3rd level.page = PAGE page.config.admPanel = 0 page.config.disableAllHeaderCode = 1 page.10 = HMENU page.10 { special = rootline special.range = 0|-1 1 = TMENU 1.NO { allStdWrap.noTrimWrap = ^^^ |*| ^ > ^^ allStdWrap.noTrimWrap.splitChar = ^ } }The expected output should be:
<a href="/">Rootpage</a> > <a href="/level-1">Level 1</a> > <a href="/level-1/level-2">Level 2</a> > <a href="/level-1/level-2/level-3">Level 3</a>
Instead, I see:
<a href="/">Rootpage</a><a href="/level-1">Level 1</a><a href="/level-1/level-2">Level 2</a><a href="/level-1/level-2/level-3">Level 3</a>
It seems that noTrimWrap does not take optionsplit into account at all, and parses only the first part of the string matching the 3 first splitChar only.
The rest of the string is discarded.I tested with wrap + splitChar, and the optionsplit works well.
-
Riccardo De Contardi changed status
ClosedNew 12/16/19, 22:18 -
Jigal van Hemert commented 01/01/20, 14:04
Confirmed. https://review.typo3.org/c/Packages/TYPO3.CMS/+/7255/ causes noTrimWrap to not support optionSplit any more. The original patch for #20793 solved conflicts between optionSplit (which assumes that “||” is part of optionSplit) and noTrimWrap by allowing a different splitChar for the latter.
The solution for the problem that noTrimWrap = | || doesn’t work should’ve been to use a different splitChar for noTrimWrap.The best way would be to revert https://review.typo3.org/c/Packages/TYPO3.CMS/+/7255/ but that would be a breaking change. I don’t see a solution to support both things like noTrimWrap = | || and optionSplit at the same time.
-
Georg Ringer changed Sprint Focus Needs Decision 06/23/24, 19:59
-
Georg Ringer commented and changed status
NewClosed 08/03/24, 07:04hey everyone,
due to the fact that those options are not that widely used anymore and changing things back probably break something else I am closing this issue now
Can you provide some sample code that shows what you expect to work?