websiteguru
websiteguru

Reputation: 493

Drupal | How do you integrate a module into views?

I'm using the decisions module for drupal and it currently has no views integration. I'm looking for a way to use some simple filters based on this module in views. How do you integrated a module with views? All of the available documentation is extremely vague.

Upvotes: 1

Views: 2538

Answers (3)

user217032
user217032

Reputation:

Adding a table and it's fields as sort, filter, arguments to drupal is surprisingly easy if you implement standard handlers.

Taking a quick pick at the code for the decisions module, the tables have nid which can be link to to views using a relationship to the node table.

Here is a good walk thru: http://views-help.doc.logrus.com/help/views/api-tables

Upvotes: 1

googletorp
googletorp

Reputation: 33275

You have 3 ways to learn about views:

  • The doxygen API manual has all the views documentation. There are some good examples etc there. I have used it myself a few times, but it can be hard to find what you want, as it is usually not as detailed as one could wish it to be.
  • The views code itself. Views implement a lot of the stuff in the same way as other modules could do.
  • Look at other modules and how they have implemented what you want to do.

Views is a complex piece of machinery and there is no easy way to learn how to use it. But with after some trial and error I'm sure you'll be able to get there.

Upvotes: 1

dmitrig01
dmitrig01

Reputation: 769

Look at some example files. Comment module is a good example - views/modules/comment.

Upvotes: 1

Related Questions