Bug #61275
closedIt is not possible to reference TMENUs
0%
Description
A TMENU can not be referenced:
lib.navigationMenu.stdLevel = TMENU
lib.navigationMenu.stdLevel {
wrap = <ul>|</ul>
NO = 1
NO.wrapItemAndSub = <li>|</li>
ACT = 1
ACT.wrapItemAndSub = <li class="active">|</li>
CUR = 1
CUR.wrapItemAndSub = <li class="current">|</li>
}
lib.navigationMenu.level_0 =< lib.navigationMenu.stdMenu
lib.navigationMenu.level_0.10 {
entryLevel = 0
1 =< lib.navigationMenu.stdLevel # this reference is not working
1.wrap >
}
Replacing the reference operator with the copy operator words as expected.
Updated by Markus Klein about 10 years ago
- Status changed from New to Accepted
- Complexity set to medium
After checking the code it is clear to me why that happens:
typo3/sysext/frontend/Classes/ContentObject/Menu/MenuContentObjectFactory.php::getMenuObjectByType($type) expects $type
to be a menu type name like TMENU, but in case of a reference this will be '< lib.....'.
Reference support has to be implemented into
typo3/sysext/frontend/Classes/ContentObject/HierarchicalMenuContentObject.php
before calling the MenuContentObjectFactory.
Unfortunately I don't know the TS API to handle such references, so somebody else needs to take a look.
Updated by Helmut Hummel about 10 years ago
- Status changed from Accepted to Needs Feedback
References only work on content object level, nowhere else.
So this works:
lib.foo = TEXT lib.foo.value = Bar page.10 =< lib.foo
This does not work:
lib.foo = TEXT lib.foo.value = Bar page.10 = TEXT page.10.value =< lib.foo.value
The reason for that is, that the implementation of references is only done in ContentObjectRenderer::cObjGetSingle() and the only case that is checked there is if the first level is a reference.
A TMENU is not a content object, but a menu object, thus it does not work there, same as it does not work in any other place in TS (except top level content objects).
Implementing this now only for menu objects might be possible at cost of performance (TS-Parser needs to be triggered) and at cost of consistency.
Implementing this on a parser level would be consistent, but I'm not sure if this is really doable with the current parser code.
So what should we do with this one?
Updated by Markus Klein about 10 years ago
- Priority changed from Must have to Could have
- Target version deleted (
next-patchlevel)
Thanks Helmut for clarifying this.
I agree that we should strive for consistency first place!
Moreover the menu generation is already really slow, so don't slow it down even further.
Updated by Alexander Opitz almost 10 years ago
I would like to close this issue, as implementation is only possible with reduction of performance for everyone.
Is it ok to close this feature request?
Updated by Markus Klein almost 10 years ago
I would close this one and create a new one "Evaluate reference handling on TS parser level" with a reference to this one.
In the new ticket we can check then if such an implementation is doable or not.
Updated by Alexander Opitz almost 10 years ago
@Markus Ok, so doing so is fine with me.
Updated by Markus Klein almost 10 years ago
- Status changed from Needs Feedback to Rejected
General feature request/evaluation in #63894.