1

Im building my menu with the following typoscript

includeLibs.myadminmenu = typo3conf/ext/my_admin/user_makemenu.php
lib.userMenu = COA_INT
lib.userMenu.10 = HMENU
lib.userMenu.10 {
    special = directory
    special.value = 184
    modules = {$modules}
    entryLevel = 1
    1 = TMENU
    1.itemArrayProcFunc = user_myadminmenu->makemenu
    1 {
        NO = 1
        NO.allWrap = |
        ACT = 1
        ACT.allWrap = |
    }
}

This works fine, but inside my makemenu method I have the following

foreach($menuArr AS $i => $menu) {
    if (array_key_exists($menu['uid'], $this->paymentModules)) {
        if (! in_array($this->paymentModules[$menu['uid']], $modules)) {
            $menuArr[$i]['doNotLinkIt'] = 1;
        }
    }
}

This doesnt work - I have tried with

unset($menuArr[$i])

this removed the menu item, but I just want it to dont link, is there any way to do this?

If its not possible to unlink the menuitem, is it then possible to override the url to another page?

1 Answer 1

0

A different approach could be:

(untested)

includeLibs.myadminmenu = typo3conf/ext/my_admin/user_makemenu.php
lib.userMenu = COA_INT
lib.userMenu.10 = HMENU
lib.userMenu.10 {
    special = directory
    special.value = 184
    modules = {$modules}
    entryLevel = 1
    1 = TMENU
    1 {
        NO = 1
        NO.allWrap = |
        NO.doNotLinkIt = 1
        NO.doNotLinkIt.if {
          # the userfunc needs to return a list of pids like
          # value = 10,12,24,44
          value.postUserFunc = user_myadminmenu->makemenu
          isInList.field = uid
        }
        ACT = 1
        ACT.allWrap = |
        ACT.doNotLinkIt < .NO.doNotLinkIt
    }
}

IMHO this is easier to read and to maintain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.