2

I have content types: Project, News, and Country.

I have a node template that displays details of a Project. This node template displays a view, which displays all the News. I want to filter all the news by the project's Country.

Project has a cck field: country_id. How do i pass it's value to my News view?


tl;dr: using a panel node-template, how do i use the node's cck field as argument?

  • Welcome to d.se :) I'm wondering how this is different from drupal.stackexchange.com/questions/20486/… where you also posted? I have posted step by step instructions, and they should be relevant for your question as well. – Letharion Mar 30 '12 at 10:43
  • 1
    So I think the critical piece of information here is number one in my answer in the linked to question. You must have a "content pane", not a "block". – Letharion Mar 30 '12 at 10:45
  • hi thanks! i just finished updating my question after trying your solution. im still lost. – Bibokid Mar 30 '12 at 10:45
  • I used content pane when I tried it. I added an argument, then went to pane settings and changed argument input to From Context.. but i cant seem to find a way to choose my country_id there.. – Bibokid Mar 30 '12 at 10:46
  • Let's take a step back. Excluding Panels from the equation all together, can you make the View create the list that you want? It sounds like the problem here is really in the contextual filters in the View? – Letharion Mar 30 '12 at 10:48
3

You need to use content pane for the view to make it accept arguments.

Then when you insert the content pane, you should be able to use the node and all fields on the node using a token system to pass any variable to the view pane. How you setup the content pane determines which types of variables it will accept.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.