0
votes

I have a page listed with a series of node titles and these node titles are linked with their nodes. Whenever user clicks a node title it displays the details related to the node and a block view displaying all the data related to the node. On this page i want to display a link to another view which also displays data related to the same node. The scenario is that currently the default block view is displaying the whole data but i want another view's link on this page which will display data of top 10 users when clicked on view's link. It is like switching between two views on same page and both of them are using the node id of the node clicked on the first page as an argument. Is there a way to do this?

Edited question: Sorry about that actually i am new to drupal and have no idea about it. Just learning it. I am really sorry to confuse you.

I am creating a website which has challenges created by one user and other users participate in these challenges. They create challenges through CCK form so each challenge is a different node and post their times to challenges through CCK form so each posted time is a node again. So now all the challenges created by the users are shown on the home page via view. Then if someone click on these challenges on homepage, then it opens up a new page which has all the details related to the challenge i.e. each challenge on the home page is linked to its node. Now this new page say View Challenge page has one view (block display) to display the timings of all the users who participated in that challenge. Currently this view block display all the user results but i want to create a link to another view on this same page which will display the top 10 results, So the users can switch between two views one is with all the results and another with only Top 10 results. When on view is visible then the other one should be hidden. Both views has challenge node id as argument. If you have any other questions just let me know i 'll try to make myself more clear.

Thanks Kanwal

1
I feel like I was almost able to understand what was going on, but not quite. Please clarify what is on what webpage, and how each webpage is generated (e.g. views, node, taxonomy). - Greg
Yeah I am with greg on this its a little hard to understand what you really want to do, ill check back later today. - theGoose
Thanks guys i did it via quick tabs module and using block display of views - Kanwal
please delete this question, or rewrite it so people can understand what you asked for, then add an answer explaining what you did to solve it. - Capi Etheriel
And how is this programming related? - user1228

1 Answers

0
votes

Take a look at views_embed_view() . The first argument is the view name, the second is the display name (block_1, or page_1 may be), and then the following arguments are the view arguments. You should be able to print the output of this function to make the view display on the node view.

You could either inject it in hook_nodeapi() ($op == 'view') or you could do it in a node template in the theme directory.