Bug #22101
closedLimit positive values in Rootline to current page
0%
Description
In class.tslib_content.php you have a function called getKey. We have a rootline with 5 pages. Look at following TS:
10 = TEXT
10.data = LEVELTITLE:-12
In this example you always get back the title of rootpage.
10 = TEXT
10.data = LEVELTITLE:12
But if $key is oversized positive you get back an empty pagetitle. Maybe you can insert something like:
if(count($arr) <= $key) {
$key = count($arr) - 1;
}
(issue imported from #M13496)
Updated by David Bruchmann over 14 years ago
In my opinion it's no bug but a feature request.
I don't think it should be implemented because it could be solved with the option slide.
Updated by Jo Hasenau over 14 years ago
This is neither a bug nor a feature but just a correct behaviour.
Negative values go "back" down the rootline starting at the current page (which is -1 in this case) - so the "last" page you can get this way will always be the root page since there is nothing "below" it and the possible result is unique.
Positive values start at the root page (which is 0 in this case) and go up the rootline until they reach the level of the current page. Now it's simply impossible to guess which branch of the tree the user will take, since there might be more than one subpage of the current page.
So a positive value MUST always give back an empty result, when the requested level is higher than the level of the current page.
Simple as that. IMHO this can be closed.
Updated by David Bruchmann over 14 years ago
Hy Jo,
after having a discussion with Stefan in the dev-list I don't understand all you wrote and why insertion of the requested lines shouldn't be a feature-request but the "bug" can be closed in my opinion too.
Here is the link to the post on the dev-list:
http://lists.typo3.org/pipermail/typo3-dev/2010-August/041172.html
Updated by Jo Hasenau over 14 years ago
I already followed this discussion, but still the request doesn't make any sense to me.
Any positive value is a fixed one, since it is always counted from the rootline at position 0. So it is clear which level the title should come from and therefor you can give back an empty value, if this level is not within the current rootline.
The negative values are relative values, counted from the position of the current page.
It's the difference between "fixed" and "relative" and the difference between "root" (unique) and "branch" (not unique), why the approach desired in this report won't work - and of course it would break existing stuff.
Updated by David Bruchmann over 14 years ago
Perhaps I didn't analyze it clear enough, I just thought it's like option slide.
Sure, I did understand your explanations but the context wasn't clear to me.
Doesn't matter - the feature or bug or whatever should be closed - don't know if you're able to do that.
@Stefan: I hope you get your requirements realized in TypoScript - In the TYPO3-Core is definitely the wrong place.
Updated by Stefan Froemken over 14 years ago
Quote: "It's the difference between "fixed" and "relative" and the difference between "root" (unique) and "branch" (not unique)"
now I understand...very good explantation. THX. OK...close this "bug".
@David:
I have written a german tutorial for class.tslib_content.php on http://typo3.sfroemken.de.
To understand all functions I had to test and read them all. While reading I stubled over this function and I don't understand it. That's why I opened this bug-report. But now I know. THX
Stefan