By japiekrekel on
I am attempting to display different content through one View Block dependant on the page on which the View Block is shown. So dependant on which page I am, i need to apply different filters (for example based on taxonomy). But how do I set this up? I assume through an argument but I am unsure how....
in my head in would look like this in made-up code:
if page == 1 {
ViewsBlock1(apply filters 1, 2 and 3);
}
if page == 2 {
ViewsBlock1(apply filters 4,5,6);
}
Thanks for your help! :)
Comments
One alternative idea is to
One alternative idea is to use two or more view block displays, then put each on their respective page. That way you could control the filters for each without worrying about arguments.
Yes, I would apply this but
Yes, I would apply this but this gives a lot of extra work as there are at least 30 pages that each need to show different content from the views. Adding them all manually would defeat the purpose of the Views module I'm afraid.
It sounds like you want to
It sounds like you want to use arguments instead of filters. It is also possible a relationship would help. Details depend on how the filters differ and how they relate to the page being shown.
Specifically my situation is
Specifically my situation is as followed:
I have Pages with content about various countries of the world. On these Pages I have a region in which I have placed a Block instance of a View that dependant on applied filters should show relevant information about that country for the specific Page I am visiting. This relevant information has been created in seperate Stories with each a taxonomy term that corresponds with the country's name (e.g. England, France, Germany, etc). Each country Page has also been term tagged with the corresponding country's name.
Now my goal is to have the View show and list only the Titles of the country specific Stories. For this it would have to filter the Stories on the taxonomy term that corresponds with the taxonomy term of the Page that the View is on at that moment.
How do I do this? :) If with Arguments, how would I do that specifically?