views:

20

answers:

1

I've created a (modest) question answers system in Drupal.

I'm using forum content type and enabled comments on nodes. I'm also using node comments module to convert comments to nodes.

Everything works great, I still have a small issue on the "Search" View. When I search for a word, the search engine displays all nodes containing that word.

However, if the node is an answer, it just displays the single answer without the parent question and the other answers (brothers).

I would like to display the question instead. Is it easy to do ?

thanks

A: 

You could edit the fields using hook_nodeapi() $op = 'search result' to include the parent question.

Jeremy French
ok, and should I execute a sql query to get the parent node id and then the parent node ? and all the children ?
Patrick
You'll probably just want the parent node, how do you cross reference the nodes.
Jeremy French
They are actually comments and they are converted to nodes by "node comments" module.
Patrick
Ahh, I see it has it's own table for this. Looks fairly simple to query, but it also has some views plugins, so you could see if you go down that route.
Jeremy French

related questions