Гость
16 Май 2013 04:59

I have this problem:

I want to hide cobalt menu

(home - my menu - order by - level up - search - and so on)

as I don't really need those options in my pages

but if I hide it then also the "my menu" item get hidden, and my client will not be able to manage his hidden/suspended records anymore

he would be forced to access backend to do so, which I want to avoid...

thus the question is:

how to hide cobalt menu only to some user-levels?

or how to keep the "my menu" item appearing for some user-levels?

Последние изменения: 02 Март 2014


pepperstreet VIP
Total posts: 3,837
16 Май 2013 11:39

Did you try all options in Section's MarkUp template? AFAIK, you can turn off any menu element, and even restrict certain elements with usergroup/ACL.

Apart from that, you could restrict the whole menu-block output in a custom markup template.


Гость
16 Май 2013 12:00

you can turn off any menu element, and even restrict certain elements with usergroup/ACL.

I understand this, but still th emenu navbar is visible even if the elements are hidden

you can turn off any menu element, and even restrict certain elements with usergroup/ACL.

you could restrict the whole menu-block output in a custom markup template.

mhhh... I am afraid I'm not enough skillfull to do that :S, code suggestions :)?


Гость
16 Май 2013 12:02

what I want to achieve is to have the navbar with "my menu" element visible to administrators, and hidden for everyone else


Гость
16 Май 2013 12:16
you can turn off any menu element, and even restrict certain elements with usergroup/ACL. 

I understand this, but still th emenu navbar is visible even if the elements are hidden

oops... I was wrong, the navbar also is being hidden if you are not logged in,

so "my menu" and navbar will still be visible to registered users and superior... but not to guests


Sackgesicht VIP
Total posts: 1,636
16 Май 2013 12:26

Maybe you can add a parameter to a customized markup template to define the user level permission for the menu block.

$this->user->getAuthorisedViewLevels() will help you in the template code to determine the user level.

Try to look into the template code and compare with on of the elements (like template switcher).

It is quite late here already. I might look into it tomorrow (later) for a better suggestion, if you still have problems.


Гость
16 Май 2013 12:34

Thank you!

for now I have solved by just enabling only the "my menu" element , as I will not have registered users on this project so I won't have the problem to have to hide that element to them


Sergey
Total posts: 13,748
17 Май 2013 07:34

I have change User menu markup template parameter from Yes/No to access level.


Гость
17 Май 2013 07:38

thank you Sergey!

Работает на Cobalt