Joel, thanks for all the help. My view already works fine. I get an empty result if there was no project flagged bu the user, but the corresponding menu item is still displayed. I think i'm missing something. I don't see what you mean by:<div>
<br></div><div>"If there is no project for that user, then the View doesn't fire, so you create the menu in Empty Text area. So one menu could be in Global:custom text, and the other in Empty Text."</div><div>
<br></div><div>Thanks again!</div><div><br></div><div><br></div><div>Toon<br><br><div class="gmail_quote">On Tue, Jun 7, 2011 at 10:12 PM, Joel Willers <span dir="ltr"><<a href="mailto:joel.willers@sigler.com" target="_blank">joel.willers@sigler.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In relationships for Flags, you can have it 'Marked by current user'. Then in Filters you can use that relationship for 'Flag: marked XXX'.<br>
<br>
If they haven't marked it, it won't show.<br>
<br>
Hope that helps.<br>
<font color="#888888"><br>
Joel<br>
</font><div><div></div><div><br>
<br>
Actually, to make it a bit more complex: there is no user reference field. The project is flagged by a certain user. This is used in the view "my_projects" as a relationship "Flags: student_selected by current user".<br>
Is there a way to still do what you described below? The only arguments that seem to be available to add are "Flags: Content ID" and "Flags: Flagged time".<br>
Or do i somehow have to create the user reference when flagging (through Rules)?<br>
<br>
Thank you so much for your help already!<br>
<br>
Best,<br>
<br>
<br>
Toon<br>
On Tue, Jun 7, 2011 at 8:59 PM, Joel Willers <<a href="mailto:joel.willers@sigler.com" target="_blank">joel.willers@sigler.com</a>> wrote:<br>
For your PHP suggestion, you would use global $user and detect the user role, but you wouldn't be able to easily use this for detecting if they have a project.<br>
<br>
For my suggestion, you can use the content type Project (I don't know your configuration, so I'm making some general assumptions), and let's say it has a user reference called field_project_user. You would set that as an argument, and in the section for what to do if there is no argument, you set a default argument as logged in user. Then you set a filter for node:type = Project.<br>
<br>
If there is no project for that user, then the View doesn't fire, so you create the menu in Empty Text area. So one menu could be in Global:custom text, and the other in Empty Text.<br>
<br>
Similar arguments can be used for many user fields, so play around with them. If you give me more specifics, I might be able to send you more explanation, but really, that should be enough for you to create it.<br>
<br>
Joel<br>
<br>
<br>
Hey Joel, thank you so much!<br>
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?<br>
<br>
Alternatively, could you elaborate a bit on your last suggestion please?<br>
<br>
Best,<br>
<br>
Toon<br>
<br>
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.<br>
<br>
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.<br>
<br>
Actually, I kinda like that last idea...<br>
<br>
Joel<br>
<br>
You could make two blocks, put them in the same place and assign visibility settings based on role. There are many options, though.<br>
<br>
Joel<br>
<br>
Hello all,<br>
<br>
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?<br>
<br>
Any ideas?<br>
<br>
Best,<br>
<br>
<br>
Toon<br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
<br>
</div></div>--<br>
<div><div></div><div>[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</div></div></blockquote></div><br>
</div>