[TYPO3-english] Flexible menu starting points
Pero Peric
pperic at mail.com
Thu Jul 24 18:46:37 CEST 2014
On 24.7.2014. 18:17, JoH asenau wrote:
>>> In this case a fully TS based version would need a rootline menu to get
>>> the uid of that particular page, but a userFunc might be the better
>>> choice regarding performance.
>>>
>>> lib.menu = COA
>>> lib.menu {
>>> 10 = HMENU
>>> 10 {
>>> special = rootline
>>> special.range = 0|-1
>>> 1 = TMENU
>>> 1.NO {
>>> doNotLinkIt = 1
>>> stdWrap.cObject = LOAD_REGISTER
>>> stdWrap.cObject {
>>> mystartingpoint.field = uid
>>> mystartingpoint.if.isTrue.field = menuroot
>>> }
>>> }
>>> }
>>> 20 = HMENU
>>> 20 {
>>> special = directory
>>> special.value.data = register:mystartingpoint
>>> ... more menu stuff here
>>> }
>>> }
>>
>> When i'm on the page that has checkbox set (value=1) all is fine -
>> mystartingpoint value is set to pageID, BUT when i'm on the page that
>> has checkbox unchecked (value=0) there is nothing in variable
>> mystartingpoint. Any hints? Going nuts after trying various things :-(
>> Thx.
>
> Did you try setting the COA to COA_INT?
> This would disable the caching and make sure that there is no issue with
> it.
>
> Actually the purpose of the first menu is, to walk up the rootline from
> the root to the current page and always write the uid to the register,
> when the checkbox is set. So the uid of last page with an activated
> checkbox should be registered in the end.
So, i suppose when if clause is true it should stop from going on
further the rootline?
Hm, i tried with COA_INT now but it's the same. I'm not sure how to
debug this so i wrote it like this.
menu_s = COA
menu_s {
10 = HMENU
10 {
special = rootline
special.range = 0 | -1
1 = TMENU
1.NO {
allWrap= You are here: | > |*| | >
|*| |
doNotLinkIt = 1
stdWrap.cObject = LOAD_REGISTER
stdWrap.cObject {
mystartingpoint.field = uid
mystartingpoint.if.isTrue.field = tx_menurootpoint_menuroot
}
}
}
20 = TEXT
20.data = register:mystartingpoint
}
and then i use marker to print value in menu_s.20. When i'm on the page
that has checkbox set it prints pageID but when i'm on the page that has
no chechbox set it prints nothing.
I also noticed that when i use strWrap.cObject as you wrote originaly i
don't get page names printed out. If i use before.cObject or
after.cObject i get those names printed. Do u have maybe some hint for
easier method of debugging this? Thx!
Regards.
More information about the TYPO3-english
mailing list