I've searched High and Low... but basically what I need is either a module, a hack or a workaround for this...

I have user panels for all of my users and I would like to make it so that when a specific node title or link is clicked on... it redirects a user to the author of that nodes users panel and not the node itself...

so basically with specific node types i want them to go to a different path /user/[author-name-raw]

I can't use path auto because it is telling me the path already exists... I dont want to use content templates to create a dodgy hack...

There must be a way? Any ideas?

JD

Comments

fighella’s picture

Can anyone see a problem to hacking the node template to make my node titles link to user pages instead of the nodes themselveS?

<?php if ($page == 0): ?>
  <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>

and making something like:

<h2><a href="<?php if  *** content type = image_gallery print 'user/' $user ?>  else do what you normally do ?? </h2>

Any ideas here? Or could anyone help me write the if ?

Im not sure what I need to do...

JD

justageek’s picture

if you are only doing it for one content type, you can create node-image_gallery.tpl.php and modify the code in that template, and all other nodes for other content types will still use default node.tpl.php

then you don't need the if statement.

fighella’s picture

hey this could be a great solution...

can i do multiple templates then?

Im assuming i just copy the node.tpl.php and rename it...

Any documentation on this I should be looking for?

justageek’s picture

http://drupal.org/theme-guide/6

yes, you make a copy of node.tpl.php, the format is node-my_content_type.tpl.php

fighella’s picture

Thank You so much, I think this is going to solve all my problems! Amazing!

fighella’s picture

one more thing...

do you know if its possible to control the link created from a view field...

so right now the link defaults to the node itself when you click "link to this node" ...

I would love to be able to say " link to the authors page of this node "

justageek’s picture

i'm not sure, I think this would again but a template override where you grab the field yourself and create the link. I could not locate a setting inside views to make this happen using the UI.