Frank Parent
Frank Parent

Reputation: 2164

How to add custom View Type in Drupal

I'm learning a lot about the Views in Drupal, but can't figure how to add new View types to the list (node, comment, user, etc).

The Query I'm trying to recreate in a View is something like "SELECT * from Quizz", which is a custom table, and I have already created a new content type named "Quizz" but I would like to be able to use it in the View module.

Thanks for your help!!

Upvotes: 1

Views: 3422

Answers (2)

Jeremy French
Jeremy French

Reputation: 12157

Take a look at the data module, or the older table wizard as a way to get views from generic tables. Both provide a UI. However I don't know how they will cope with complext relationships between tables.

Upvotes: 1

ceejayoz
ceejayoz

Reputation: 180014

You'll need to use hook_views_data. Full documentation is in the help for the Views module, but here's a bit of example code.

Upvotes: 3

Related Questions