tags:

views:

682

answers:

1

I was wondering if there is a built in method in Drupal, to link to nodes created by a user. In my case, each and every user can create a node called "profile". I want to add a link in the menu, that links directly to that profile node.

I can do it by making a module that just checks for a link, e.g. mysite.com/?goTo=profile and then just write the sql to find the first node of type "profile" in the db and then just redirect to that, but surely drupal must have some kind of syntax or something by which you can specify that it must link to the first node of type x of user y?

+1  A: 

I would create a view (limit 1, filter on content type and user field) and use either Insert View or views_embed_view() to bring it in.

cpharmston
That's not a bad idea at all! :-) Would still prefer to link directly to the node (as it will show the correct link in the title bar) but I guess this could do the trick.
RD

related questions