Block on user profile only I have blocks for several profile types that links to users photos videos etc. (think myspace)

With arguments it works nice, block is visible only on page created by userXY and leads to other content made by userXY.

But, when userXY logs into his account and goes to "My account" it leads to www.example.com/user

Now blocks from all profile types are visible and they lead to false urls. The correct block is also there and works well but i can't find a way to limit other blocks not to be shown here.

I am using profile2, tokens and real name module.

Other problem which was thinking of to solve the issue was to change pattern for /user into /role/realname or anything that will change from default /user but nothing seems to work (pattern is ignored).
I think you have 2 main options:

You can use some custom PHP to control the blocks visibility. Something like:

global $user;
$account = user_load($user-&gt;uid);
if($account-&gt;profile_type[LANGUAGE_NONE][0]['value'] == 'some value') return true;
return false;


Or I think this is a good use case for the Context module. This allows you to create different "contexts" that your blocks should appear in. An example from the Context help file says:

You want to create a "pressroom" section of your site. You have a press room view that displays press release nodes, but you also want to tie a book with media resources tightly to this section. You would also like a contact block you've made to appear whenever a user is in the pressroom section.


Add a new context on admin/build/context
Under "Conditions", associate the pressroom nodetype, the pressroom view, and the media kit book with the context.
Under "Reactions > Menu", choose the pressroom menu item to be set active.
Under "Reactions > Blocks", add the contact block to a region.
Save the context.