0

I have one taxonomy term, Country, which is linked to another, People. One people is from one country.

How can I make a view in my Panel, using Contextual filters, in order to show the specific view I prepared for "Country" ? I tried to use contextual filters to do so, and it works when I use the preview with the Country ID - but not in Panels.

4
  • I'm not sure I follow what you're ACTUALLY asking - perhaps you could provide a little more information?
    – Chapabu
    Commented Aug 20, 2013 at 15:53
  • Are you sure you mean taxonomy term or do you mean vocabulary (collection of terms)? Terms: US, Canada, Mexico / Vocabulary: Countries Commented Aug 20, 2013 at 15:59
  • Sorry if unclear, I just wanted to know how to display a view related to a taxonomy term link, while using a contextual filter for example.
    – Marcandria
    Commented Aug 20, 2013 at 16:03
  • @PatrickKenny I want to use terms and not vocabularies, my mistake while I typed ... If my people is from France, I want to show a view I created for France - is it clearer ?
    – Marcandria
    Commented Aug 20, 2013 at 16:05

2 Answers 2

0

If you want to display a different view for a country, I think what you probably want to do is use the Taxonomy Term override page rather than using contextual filters.

To do this, go to the pages admin screen (/admin/structure/pages). Then, enable the Taxonomy term template panel to override the display of taxonomy terms using Panels.

To show a custom view, you can edit the Taxonomy term template panel. This will allow you to use the taxonomy term as arguments for your view, because Panels understands that you are overriding the taxonomy term display.

8
  • Thanks for your answer, but I admit my question is not very well asked ... In fact, I need to have 2 blocks, with one for the "People" and one from the "country" Like Block 1 : France Capital: Paris [Photo] President: blabla Block 2 : Name: aaaa Surname: bbb Address: ccc Country: France Am I clearer ?
    – Marcandria
    Commented Aug 21, 2013 at 6:31
  • In that case, you can add two different views to the taxonomy term override page. View 1 shows the country information (capital, photo, etc.) View 2 shows the people in that country. You can just create both views and add them to the "content" of the panel. Commented Aug 21, 2013 at 6:38
  • But how do I get the country ID from one view to pass it as a contextual filter parameter in my second view ?
    – Marcandria
    Commented Aug 21, 2013 at 6:49
  • If you are using Panels, and you are overriding the taxonomy term display, use a Content Pane display (in Views, instead of a block display) and enable "use panel argument" (you will have to set the appropriate context). This will allow you to populate your contextual filter with the country ID being passed to panels. Commented Aug 21, 2013 at 9:30
  • Yes, this is what I am trying to do - but how can I pass the country ID to the other panel ? Since I only have the country name displayed in my term view ?
    – Marcandria
    Commented Aug 22, 2013 at 7:28
-1

I managed to do what I wanted to by taking the problem reversely :

  • I created my view, then added a contextual filter not by "Country ID", as I did, but by "People ID"
  • Then I configured the argument input in Views by taking the source from the argument of the panel (which matched my "People ID") and it was taken in account by my Views and actually works.

Drupal is quite complicated to understand sometimes ! :) Thanks for advice Patrick Kenny ;)

Bye

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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