I am new to Drupal and have learnt about custom blocks.

Basically, I am trying to create a search page where on the left column will have all the filter/search criteria.

On the right column the results will be displayed in a specified format in a custom block. Not sure where to start on this work.

I have my back end ready with all the parameters going in correctly and results are displayed out of a stored procedure.

Not sure about how to wire up the front end filter criteria fields with backend SQL parameters.

I am using Drupal 8 - bootstrap theme custom blocks to design the page and SQL server (using SSMS tool) backend to achieve this. Any guide on how to start this? Thanks!

  • 2
    Hello Rick, and welcome to drupal stackexchange, why you should create a custom block for search, you didn't try to use search api it support views, and views will handle the creation of the block and it's filter criteria and so on .. – berramou Dec 1 '19 at 12:16
  • @berramou Hi - Search api supports only site wide search right? I have a bunch of filters like programs, location, availability etc. User will select them and when they hit submit they should see the results. Hence I thought custom block is needed – Rick Dec 1 '19 at 12:18
  • 1
    if i understand you right, the result come from another database ? – berramou Dec 1 '19 at 12:20
  • @Rick, if the data you want to query is Drupal content, you should not query the database using queries but using Drupal content system (Search API is a start). If berramou is right and your data is in another database you may use direct queries. – sanzante Dec 1 '19 at 12:47
  • The results come from the same database where Drupal objects are also living. Will search API be still helpful? – Rick Dec 1 '19 at 20:02

Your Answer

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

Browse other questions tagged or ask your own question.