[TYPO3-english] Flexible menu starting points

Pero Peric pperic at mail.com
Wed Jul 23 23:53:07 CEST 2014


On 23.7.2014. 16:47, JoH asenau wrote:
>> What would be more user friendly is to put only a checkbox "Menu
>> starting point" but then i should do something like:
>>
>> if (levelfield:-1, menuroot, slide) == 1
>>    special.value = pageID_of_the_page_where_this_is_true
>>
>> so i wonder if this is possible? Thx!
>
> 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
>    }
> }
>
> This way the register always gets the latest startingpoint from the
> rootline.
> And you don't have to assign that field to the rootline fields anymore,
> since it is not fetched by levelfield.

Thx. Joey but it seems something is wrong. I spent all night debugging 
this little piece of TS but without success. I really suck with TS. So 
this is what i found out:

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.

Regards.


More information about the TYPO3-english mailing list