P
P
Pavel2014-10-20 14:36:53
Drupal
Pavel, 2014-10-20 14:36:53

How to correctly create a context filter in views 3 ?

Initial data:
There are several types of materials, with fields:
Country (taxonomy term)
Region (taxonomy term)
District (taxonomy term)
Locality (taxonomy term)
Task:
It is necessary to build a views view (using context filters, as I understand it) with URL with the following pattern:

example.com/ catalog / Тип материала / Страна / Регион / Район / Населенный пункт

those. should get the following result,
page with URL :
example.com/ catalog / Тип материала /
- should show all nodes of the given material type
page with URL :
example.com/ catalog / Тип материала / Страна /
- should show all nodes of the given material type that refer to the general term from the dictionary Country
URL page:
example.com/ catalog / Тип материала / Страна / Регион /

- should show all nodes of this material type that refer to the general term from the Country dictionary and to the term from the Region dictionary
, etc.
My solution: I
created a context filter with a URL like - catalog/%/%/%/%/
As arguments I take "Term name converted into term ID". It is not possible to get the material type for this filter, and the filter does not work if not all arguments are valid.
those. if you set the URL:
example.com / catalog / Россия / Камчатский край / Быстринский район / Эссо

then the filter will work and give out all the nodes that relate to these parameters (except for the type of material)
if, however, set the URL:
example.com / catalog / Россия / Камчатский край / Быстринский район

then the filter will no longer work - it will give out 404.
We need your opinion on how to correctly compose views. Expanded filter and pass via GET do not offer, only clean URLs are needed

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
andead, 2014-10-20
@pantey

View URL should be "catalog"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question