So I set up a view with a page at users/%/photos. This page will show a user all of their photos on one page and allow other users to see them as well.
I have already set up the link for other users to use like this:
<a href="/users/<?php print $account->name; ?>/photos" title="View My Photos">My Photos</a>
The code above was added to the user profile template page and the PHP code just returns the user name that the profile belongs to (JFYI).
Now I need to pass the logged-in users name to a menu I have set up that only logged in users can see. The menu will have links like the following:
My Photos | My Videos | My Stories | etc.
How can I do this so I can create the menu with Drupal's menu system and pass the variable to it if I can't use PHP or create the menu with views?
Any help will be greatly appreciated and give lots of karma.
Cheers,
Latte/
Comments
Check out the Me module. It
Check out the Me module. It creates an aliase 'me' that can be used in menus, etc.
I've tried that and it didn't
I've tried that and it didn't work.
"users/me/photos" goes to a page not found.
Unless that's not how you would do it?
Latte/
Hmm... I haven't run into
Hmm... I haven't run into that issue. Check the path to see if it is users/me/photos or user/me/photos.
Maybe I am doing something
Maybe I am doing something wrong. Can you tell me how you would set it up to make it work?
Wes/
When I use the module I
When I use the module I simply create URLs like user/me/photos. I did notice that is uses user (singular) and not users (plural). Not sure if that makes a difference.
On a side note... if you are using Views to create these pages you could make those act as "tabs" that show up on the user profile page instead of trying to make a menu.
That tab idea was perfect. I
That tab idea was perfect. I didn't even think about.
You are my hero!
Latte/