It is not possible to reference TMENUs
A TMENU can not be referenced:
lib.navigationMenu.stdLevel = TMENU
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
entryLevel = 0
1 =< lib.navigationMenu.stdLevel # this reference is not working
Replacing the reference operator with the copy operator words as expected.
#1 Updated by Markus Klein about 5 years ago
- Status changed from New to Accepted
- Complexity set to medium
After checking the code it is clear to me why that happens:
$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
before calling the MenuContentObjectFactory.
Unfortunately I don't know the TS API to handle such references, so somebody else needs to take a look.
#2 Updated by Helmut Hummel about 5 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?
#3 Updated by Markus Klein about 5 years ago
- Priority changed from Must have to Could have
- Target version deleted (
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.