0

On my homepage, I created a view for group contents with relationship on "Group content" and "Group". I want to create a contextual filter that when I search on the exposed filter, results will be displayed on new page.

I have an exposed filter of "Category" and "Region" and without contextual filter the result displays on the same page.

I tried filtering with field "Name" as "Display a summary", and I get this:

Display on summary

But when I manually click on any item and check its URL, i'm getting this:

http://localhost:8888/drupal-8.2.3/home/Mozilla%20123?field_trade_type_job_target_id=All&field_region_business_target_id=All

And I can't search to other items anymore since I am on a filter specific path, in the example above, /Mozilla%20123?

I tried another field name, "Category" and I get this, since the 3 given examples are in the same category:

enter image description here

18 is a taxonomy path. When I manually click the content, I am directed to:

http://localhost:8888/drupal-8.2.3/home/18?field_trade_type_job_target_id=All&field_region_business_target_id=All

with this content:

Category

This image supposed to be what I want to achieve in the first place when I click search on the exposed filter in the homepage.

Any help is greatly appreciated. Thanks!

1 Answer 1

0

Alright, I found the solution to my issue.

These are the steps I come up and followed.

  1. Add taxonomy term relationship to the view.
  2. On the Contextual filter, search "Name" with taxonomy as description
  3. Under "WHEN THE FILTER VALUE IS IN THE URL OR A DEFAULT IS PROVIDED", tick "Specify validation criteria"
  4. Choose the desired vocabulary.
  5. Save and test in the Preview section.

Your Answer

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

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