Drupal Search function in custom module

by vinox   Last Updated January 31, 2019 09:07 AM - source

I created a drupal custom module for my website, the module functionality is it display list of students who have registered in my site. Now I want to update my custom module with search functionality, the search function should like google search function.

My custom module look like following structure

Current Module Look like

Now i want to implement the search function in my custom module when i search using the fields of the table like student name,gender,author name,status.how to do this?

Expecting result

Thanks in Advance.

Tags : 7 search


Answers 1


You have few options:

  1. Use hook_views_data() to hook your custom tables with Views.

  2. Use Data module as it features automatic integration with Views.

  3. Reorder your setup to use Drupal's node type/user profile/entity, which has Views support out of the box.

Doing it really manually will be a waste of time, unless you need some very specific functionality that can be hardly achieved by using Views for it.

Views will also provide you with caching, paging and it will be easier to maintain it in the future.

Aram Boyajyan
Aram Boyajyan
October 01, 2013 07:25 AM

Related Questions




Api serach with Api solr

Updated June 12, 2015 11:03 AM