I'm using Content Profile to allow my users to create their own profile nodes. I'm not sure if that makes a difference here, so I want to point it out. I'm also using Panels to control the layout of the user profiles.
When I go to a user's account page, I see Home >> My account
, if I'm logged in. If I'm not logged in, I only see Home
.
When I go to my own account page, I only see Home
.
What I would like to see is:
Home >> User Profiles
("User Profiles" will just be a path to a view that displays all the user profiles on the site.)
I've tried using a Custom Breadcrumb for Module Page, with the Module Page dropdown menu set to modules/user/user-profile
but this did not work.
What am I doing wrong? Any help would be very much appreciated.
Thanks!
Comments
Comment #1
megan_m CreditAttribution: megan_m commentedsubscribe
Comment #2
MGN CreditAttribution: MGN commentedYour approach is correct - the user-profile template is the one you are looking for.
I tracked the source of this bug down to a problem with breadcrumb caching. The fix (I hope) has been committed to the 6.x-2.x-dev version for further testing. Can you try the latest code and verify that this solves the problem?
Comment #3
bohz CreditAttribution: bohz commentedHallo.
just tested the very setup described by OP with the latest 6.x-2.x-dev and it works as expected.
(using content profile but not panels)
Thanks a lot!
Comment #4
dmetzcher CreditAttribution: dmetzcher commentedGood to know. Thanks!
I ended up coming up with another approach that worked nicely. I wonder what advantages doing it the way I was trying to do it would have over doing it the way I did it below. Can anyone shed some light on this? Basically, I'm getting what I want out of it. If I'm logged in and view my profile, I see a "Home" breadcrumb. If I'm viewing another user's profile (whether I'm logged in or not), I see a custom breadcrumb that I added. The second one below adds breadcrumbs to the pages that come after
user/username/
, such asuser/username/edit
anduser/username/track
, etc.I created three custom breadcrumbs. They are below. Thoughts?
================================================================
User Profiles: Profile Page (All users except current) with PHP snippet
Type: Path
Breadcrumb Visibility:
Titles:
Member Profiles
Paths:
users/profiles
================================================================
User Profiles: Profile Page Tabs (All users except current) with PHP snippet
Type: Path
Breadcrumb Visibility:
Titles:
<?php return array('Member Profiles', user_load(arg(1))->name); ?>
Paths:
<?php return array('users/profiles', 'user/'.arg(1)); ?>
(The PHP above in the Titles and Paths fields produces breadcrumbs like
Home » Member Profiles » James Smith
, where "James Smith is the actual username for the profile being viewed.)================================================================
User Profiles: Profile Page Tabs (Current user) with PHP snippet
Type: Path
Breadcrumb Visibility:
Titles:
My Account
Paths:
user
================================================================
Comment #5
Elder Brother CreditAttribution: Elder Brother commenteddmetzcher - Currently trying to run through your solution to this problem - How do you allow PHP to be used in the 'Titles' field? I'm getting a warning -
'Use of PHP in titles is not permitted and will be filtered out.'
Thanks for your work so far in this, I've spent an unholy amount of time on this (relatively small) issue as it should be so simple to solve..
Cheers.
Comment #6
MGN CreditAttribution: MGN commented@bulkhead, make sure you have enabled the 'Allow the use of PHP to set titles and paths' option on the custom breadcrumbs configuration page (admin/settings/custom-breadcrumbs).
@dmetzcher, I don't see a problem with this approach. Its a good demonstration of how breadcrumb visibility can be used to customize the breadcrumb trail. Thanks for sharing.
Comment #7
dmetzcher CreditAttribution: dmetzcher commented@bulkhead: MGN beat me to it and answered your question.
@MGN: OK, thank you. :)
Comment #8
Elder Brother CreditAttribution: Elder Brother commentedGreat - Thanks for tip - Hadn't even come across the Custom Breadcrumb settings before (argh).
I'm using Advanced Profile (which also requires Content Profile) and have managed to get other user's profiles displaying a custom breadcrumb as you have suggested. However, if you edit another user the trail changes to 'My Account', which I think may be coming from the Advanced Profile module. I'm unsure how to amend the URL alias for user/%/edit, and whether this is necessary to get the breadcrumb consistent.
What are the paths (or panels..or module pages) that you are applying the three breadcrumbs to exactly, and have you been able to correctly breadcrumb user/%/edit?
I have aliased the following paths -
user -> my-profile
(using automated path) user account page paths: members-directory/[uid]
Sorry for the slightly clueless questions, I hope I'm not de-railing the topic.
Comment #9
dmetzcher CreditAttribution: dmetzcher commentedRe: Comment #8
I'm not seeing that on my site.
When I click "Edit" on another user's profile (this assumes I'm an admin and can edit someone else's profile), I see the breadcrumb as
Home » Member Profiles » John Smith
(where "John Smith" is the username). If I then click the secondary tab to edit the user's Content Profile node, I see the same path (Home » Member Profiles » John Smith
).I believe that one of the custom breadcrumbs that I listed in comment #4 above is controlling this. Specifically, I think the one labeled "User Profiles: Profile Page Tabs (All users except current) with PHP snippet" is handling the Edit pages. I say that only based on my PHP comments for that one.
Try creating that one on your site and let us know if it works.
Comment #10
Elder Brother CreditAttribution: Elder Brother commentedThanks dmetzcher, I think I finally ironed this all out, though I somehow made it more involved than required.
Right, now to sort out those pesky forum breadcrumbs..
Comment #11
MGN CreditAttribution: MGN commentedI think this can now be closed. If there is more to do here, please reopen.
Comment #12
andreiianusco CreditAttribution: andreiianusco commentedHello,
What do I have to put into the "Specific Path" field?
In pathauto I have set up users/[user-raw] for user paths.
Thank you in advance,
Andrei