[support] Dynamically display menu items?

toon severijns toon.severijns at gmail.com
Tue Jun 7 18:46:50 UTC 2011


Hey Joel, thank you so much!
I think i could do it if i would be able to load the currently logged in
user in the "Show if the following PHP code returns TRUE" box of the menu
block. Can i do that? How?

Alternatively, could you elaborate a bit on your last suggestion please?

Best,


Toon


On Tue, Jun 7, 2011 at 8:17 PM, Joel Willers <joel.willers at sigler.com>wrote:

> If it were me, I'd use Views and detect the User based on role and probably
> use Custom Field module for PHP and do all sorts of tests in there.  Since
> it's a block, though, arguments aren't passed, so you could do a Default
> argument from PHP and do all sorts of fun PHP code in there, so you wouldn't
> need an additional module.
>
> Or you could assign a role using a Rule, or have the User based on an
> argument (again, default argument, Current Logged in User), and use Empty
> Text to show a different menu based on the existence of that project.
>
> Actually, I kinda like that last idea...
>
> Joel
>
>
> -----Original Message-----
> From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On
> Behalf Of Joel Willers
> Sent: Tuesday, June 07, 2011 1:03 PM
> To: support at drupal.org
> Subject: Re: [support] Dynamically display menu items?
>
> You could make two blocks, put them in the same place and assign visibility
> settings based on role.  There are many options, though.
>
> Joel
>
> From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On
> Behalf Of toon severijns
> Sent: Tuesday, June 07, 2011 1:01 PM
> To: support at drupal.org
> Subject: [support] Dynamically display menu items?
>
> Hello all,
>
> Let's i want to display or not display a menu item depending on some
> property of the logged in user. E.g. when my user has selected a project
> (i.e. a reference to the project can be found through the user) i want to
> display a menu item "my project", if not i want to display a different menu
> item "available projects". How do i do this? Context? Rules? Menu hooks?
>
> Any ideas?
>
> Best,
>
>
> Toon
> --
> [ Drupal support list | http://lists.drupal.org/ ]
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20110607/69af5ef2/attachment.html 


More information about the support mailing list