3

I have created a user menu as shown below

My Account

I am using Edit Profile and Me alias module and the menu system is as below

  1. Edit Account : user/uid/edit
  2. Edit Profile : user/uid/edit-profile
  3. Logout : user/logout

This works fine but I am not able to display it on http://localhost/user or http://localhost/users/uname (alias to the former url). I wanted to show this menu only on that page.

In the 'Visibility settings' of the block, using 'Only on listed pages' option I tried various like user, users/me, http://localhost/user, http://localhost/users/me, but the menu is not appearing on the user page. When I check it with other pages, it works fine. Any idea what might be the cause?

  • How Me alias module works? Try printing the page argument arg(1) and check what it prints. Set block visibility accordingly. – niksmac Apr 27 '12 at 12:22
  • it is a real cool module in which instead of using uid we can use me, so that we dont require to make use of tokens or remember the uid of any user. – AjitS Apr 27 '12 at 12:32
  • What is the page argument arg(1) ? – niksmac Apr 27 '12 at 12:37
  • it is giving the output as me – AjitS Apr 27 '12 at 12:42
  • Have you tried it with a wildcard *? Like user/* and users/*. Also are you certain the block region exists on the user pages? You might have a custom template file like page--user.tpl.php that doesn't print the region perhaps. Just wild guesses though. Also recommend trying it with the context module. It has a "debug" reaction which will tell you which contexts are active when you visit a page. – Beebee Apr 27 '12 at 13:33
2

I have been searching for this for 2 days now, and decided to go for bounty. But, didn't know the solution was so simple. I tried doing the same on fresh install of Drupal and it worked fine. And kept on adding the modules one by one, again testing the functionality for any change. It appeared to me that after disabling Menu token module, the requirement worked absolutely fine.
Then I checked to see if I gave a wrong token replacement. And the menu structure which i was using was as below

--My Account with path [node:url:absolute] which i thought would direct to same page.
----Edit Account with path user/me/edit
----Edit Account with path user/me/edit-profile
----Logout with path user/logout

And I used gave the path as *user/** in the Visibility settings of the block(highligted of corporate theme) as discussed in question and comments above,

The Problem identified(as per me) was that I was considering user profile page as a node which I think now is wrong, so the token [node:url:absolute] was actually a wrong token and hence the menu was not displaying on user page. What I did is changed it simply to [current-page:url] (as I wanted the user to be on same page, and I suppose we cannot give # in the path of the menu to achieve it)as shown in fig below and used the same visibility settings and it worked :)
So, basically the parent menu path was wrong which created the problem. Nevertheless, it was good learning experience!!

My Account menu

1

Your configuration will work fine, i hove tried a same scenario. See attached screenshot.

enter image description here

enter image description here

enter image description here

enter image description here

There is some miss configuration or Module conflict for sure.

Specify the list of modules + theme

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.