Answer the question
In order to leave comments, you need to log in
How to access a specific menu item?
Good day. I have a question that I can’t find an answer to in the search, or the solution method is the one that I already know, but I can’t use it. The problem is that you can not use the extended mode. How to access a specific menu item and apply an authorization check to it, if the user is not authorized then styles are applied?
<?if ($arItem["DEPTH_LEVEL"] == 1):?>
<li><a href="" class="<?if ($arItem["SELECTED"]):?>root-item-selected<?else:?>root-item<?endif?>"
<?if (!$USER->isAuthorized()):?>style="color: #00ff43;" <?endif?>
title="<?=GetMessage("MENU_ITEM_ACCESS_DENIED")?>"><?=$arItem["TEXT"]?></a></li>
<?else:?>
<li><a href="" class="denied" title="<?=GetMessage("MENU_ITEM_ACCESS_DENIED")?>"><?=$arItem["TEXT"]?></a></li>
<?endif?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question