What I want is , when a user searches for a special product , for each single search result a block of similar products show up (containing products image and product title as images alt).

I do have a taxonomy vocabulary called usability with terms gaming , light weight and ... ,

so if a search result is of kind product , the block of related products should be seen under it

So my questions are :

  1. how to alter search result view so I can place my block
  2. how can I fetch data of an result item to pass it to view filter
  • So, what is the question? – Geoff Jul 6 '15 at 21:02
  • @Geoff sorry I edited my question – user49365 Jul 6 '15 at 21:24
  • What is the search engine? The drupal default sezrch form or Views module sesrch? – M a m a D Jul 7 '15 at 0:18
  • @Drupalist the search engine is drupal core search – user49365 Jul 8 '15 at 22:10

you should be able to do with a combination of these:

Views Field View Module

This module allows you to embed a view as a field in a view. A new field handler is made available, so this can also be used in area (header/footer/empty) handlers as well as rows.

This view handler can accept arguments from fields of the parent view using tokens and pass them into the child view for each row. Raw or rendered token values can be used, as well as static values.


Views Related Content Module

Views Related Content is an extension to the Views module. It helps show the related contents, related nodes on the content detail page. This module makes it easy for you to work with contents, nodes by adding the filter criteria by Author, Content Type, Taxonomy Terms in the Views configuration.

Adding the related content view as a field in the primary view should show the results for each row. Exactly how to integrate them depends on your set up.

  • These modules description made me confused , but I will try it , thanks for help , do you introduce any help for these modules? tutorial or ... – user49365 Jul 6 '15 at 21:59
  • @Drupars have only used the Views Field View module, and the README explains everything farely well - you'll have to search for the other one if the documentation with it is insufficient – Geoff Jul 6 '15 at 22:06
  • I read the Readme and it helps , of course I think this will not work for search results cause they are not outputted as views but I found this module useful and thanks for help – user49365 Jul 6 '15 at 22:31
  • I wanted to vote your answer up but it said I need to have 15 reputation , I will do that whenever I reached that reputation – user49365 Jul 6 '15 at 22:32
  • you tagged the question with Views and Search-Views, so I assumed you wanted a Views answer – Geoff Jul 6 '15 at 22:48

Your Answer

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