just curious, michelle, why you didn't include with adv profile a standard .tpl file with a redirect that someone could place in their theme folder and have the uprofile page redirect to the advprofile (user account) page. Just as an option if someone wanted this. It works great, and no one ever stumbles on the unstyled profile page which just exists in cyberspace.
I was trying to remember how to do this for a while and i realized you had it included with the original how-to zip file on your website. If anyone's interested i just created a node-uprofile.tpl.php file (name the 'uprofile' the name of the nodeprofile content type you'd like to direct) in my theme folder and just put inside:
// We don't ever want to go to the usernode itself. Always redirect to the user page.
drupal_goto("user/$node->uid", NULL, NULL, 301)
Comments
Comment #1
michelleNo particular reason. I just didn't think of it. I'll add one in my next update. I should really go over that tutorial again and see if there's anything else I'm missing. I know I still don't have a good taxonomy as interests replacement... Have some ideas but need to follow through.
Thanks for the suggestion,
Michelle
Comment #2
michelleNot really a patch but helps with my sorting... :)
Michelle
Comment #3
michelleThanks, will be comitted shortly.
Michelle
Comment #4
lukevr commentedUser Listing doesn't work with this tpl.php
Comment #5
lukevr commentedComment #6
lukevr commentedsimple example of fix, of course node-uprofile.tpl.php could be more complex.
Comment #7
michelleWhat user listing?
Michelle
Comment #8
iaminawe commentedHi,
I have found an issue with this redirect together with the faceted search module.
Basically I am using Faceted Search to list user related taxonomy's to filter the users in a more advanced search. I have 3 main profiles for individual, school and company and have setup the above redirect for each of them.
http://cutlass.websitewelcome.com/~iamasa/community
When I click one of the terms it tries to filter it with this url http://cutlass.websitewelcome.com/~iamasa/community/search/%252Fresults/...
Because the returned search contains profiles of all three member types, it seems to automatically redirect to the first user profile found in the search (or pulled from the querystring) instead of returning the search results. Is there a simple solution to this? Can the redirects only be applied on certain pages like search/results/* or something.
Thanks in advance for any assistance
Gregg
Comment #9
michelleThe simplest solution is don't use the .tpl if it causes problems for you. It's not needed for the module to function. It's just there so if the user ends up on the usernode somehow they get redirected. If you don't want this to happen, don't use the .tpl.
Michelle
Comment #10
dtabach commentedRedirecting to user page, although a good idea, will lead to another issue: http://drupal.org/node/283453
Comment #11
iaminawe commentedBut the redirect is a really important piece of functionality...
Faceted search or Views Fast Search both return lists of members profile teasers that when clicked on take you to the nodeprofile page rather than the user page. This is frustrating as I have spent a lot of time crafting the user pages using your Advanced Profile module which is really great by the way.
Is there any way to redirect without using the .tpl pages? Is there any way that the redirect only works on the actual full nodeprofile page. i suspect it may be working on the teasers that are returned in the search results but I am not sure.
Do you have any other suggestions?
thanks
Gregg
Comment #12
michelleOh good grief. I must have had a brain fart when I did this. I couldn't figure out why you were talking about the nodeprofile page since I thought the .tpl was for the usernode which is what I had in the original tutorial. So I managed to not only misread the issue but actually implemented it while thinking I was doing something else. LOL! Too many late nights, I think.
Anyway, this is the code for the profile node itself that was from the original tutorial, which should take care of the problem:
I'll get it sorted in the package next time I work on the module.
Michelle
Comment #13
iaminawe commentedHi Michelle
Thanks for the clarification. I try that code and it now returns the result in the title but nothing below. It seems to hide the nodeprofile teasers that are returned in the search results so there is nothing to click on to redirect to the user page. I tried it with tags and search and its the same...none of the nodeprofile teasers are displayed.
Am I correct in assuming that code goes in the same place on the nodeprofile-profiletype.tpl.php file that sits in the root of the theme?
Any ideas?
Thanks
Comment #14
lukevr commentediaminawe, just try my fix ;)
http://drupal.org/node/259059#comment-916841
Comment #15
iaminawe commentedthanks Michelle... sorry for being too slow to see that but a few posts above... sometimes you look so hard you just dont see some things :)
that goes a long way towards solving my problem
Thanks
Gregg
Comment #16
mrgoltra commentedsubscribing.
Comment #17
michelleI'm not supporting nodeprofile anymore and bio already handles this. Will revisit in D6 if content_profile doesn't handle it.
Michelle