redirecting user to node ...

Events happening in the community are now at Drupal community events on www.drupal.org.
liliplanet's picture

Hi All,

Just a little confused here and perhaps a question for Michelle :)

As many links i.e 'add ... nodereview, flag, etc' fall automatically in the links of nodes of your content types, why do we redirect the content type 'profile' to the usernode? as in node-profile.tpl.php as follows:

<?php
// We don't ever want to go to the nodeprofile itself. Always redirect to the user page.
if (arg(0) == "node") {
 
drupal_goto("user/$node->uid", NULL, NULL, 301);
}
?>

then in node-usernode.tpl.php we:

<?php
// 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)
?>

Should we not always be redirecting the usernode to the content type 'profile' (nodeprofile)? The problems I've been having is we have to manually insert the links on node-profile.tpl.php such as 'add to buddylist, review this node, flag this content, etc' which all appear easily on any other node content type (and some it's not possible at all on the usernode).

Not only that, but the title of the node can then be a cleaner SEO, and not the username, but what we want specifically.

Have now reinstalled vanilla sites at least 17 times and think getting the hang of what plays with what, but it's just a niggling question in the back of my mind.

  1. Perhaps any clarification on this .. what are the benefits of going to the usernode instead of the content type 'profile'?

  2. I think it's a problem that Drupal does not have a profile solution that is compatible with views and as above, we have to use redirects plus creating a double entry for firstly usernode and then the nodeprofile. Surely it could be one basic module (as the previous profile.module) but with views support and then able to add more content types as a nodeprofile.

I'm totally appreciative of the amazing capabilities of Drupal, and speaking out of turn as I do not really develop, but honestly trying not to bloat entries on my website, and would most appreciate any input.

Look forward to any reply.
Lilian

Comments

.

michelle's picture

I suggest redirecting from both the profile node and the user node to the profile page because that's where we want the user to end up. The usernode is a blank node and the profile node doesn't have the complete profile.

Michelle


See my Drupal articles and tutorials or come check out the Coulee Region

Thank you so much for your

liliplanet's picture

Thank you so much for your reply Michelle. I understand your suggestion 'redirecting from both the profile node and the user node to the profile page', but how would I redirect to the node type 'profile'?

<?php
// We don't ever want to go to the nodeprofile itself. Always redirect to the user page.
if (arg(0) == "node") {
 
drupal_goto("user/$node->uid", NULL, NULL, 301);
}
?>

Would I change the following as well ..?

<?php
// 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)
?>

Again, thank you so much for your help.

Look forward to your reply.
Lilian

.

michelle's picture

You mean redirect the usernode to the nodeprofile node?

Something like...

<?php
$nodeprofilenode
= nodeprofile_load('TYPE_TO_LOAD', $node->uid);
drupal_goto("node/$nodeprofilenode->nid", NULL, NULL, 301)
?>

You'll want to take the redirect out of the nodeprofile's .tpl otherwise it will just redirect again to the user page.

Michelle


See my Drupal articles and tutorials or come check out the Coulee Region

it's working somehow

nchase's picture

the question is when you are redirection someone from node profile to the profile. The profile itself is loading the node profile information if it is integrated. How could do you load the node profile information within the profile?

Synergy is something essential - New-Tronic.com

Profiles as nodes

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: