1

Drupal 7 admin panel, when clicked on people, a form with drop-down filters is visible.

user filters http://www.imagesup.net/?di=914041271981

How can we create above filters in our custom modules ?

I have tried goggling, but when searched filter in Drupal, it returns text filters which replaces text.

I have a custom module in which list of items are show, I want to filter items based on different fields.

Any help would be appreciated, thanks !!

  • Why can't you try Views module – wolverine Jun 30 '14 at 12:57
  • can we use views module with custom tables ? I've create module, declared hook_menu, a form which shows list from table using select query. – harnish Jun 30 '14 at 13:05
  • You can, but for that you have expose your table/data to views using hooks. But instead of custom tables why can't use Drupal features like node/entity api. – wolverine Jun 30 '14 at 15:04
0

Well you have 2 options:

  1. Declare your custom tables with Views. This can be tricky, and take some trial and error, but gives more flexibility going forward.
  2. Declare a custom page in your module (using hook_menu). Then just build a form with the search options you want and build a query. See the Examples modules if you're not sure how to build a page.

Your Answer

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

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