tags:

views:

32

answers:

3

Hello, I have an existing database that holds information about upcoming meetings in my organization. I would like to be able to display this information in datatable type of format upon which I can then filter and sort the information (possibly jquery sort). Can anyone point me to some kind of tutorial that would give me an idea of how to do this? I assume I can do something with CCK and Views, but I'm not sure exactly what is involved.

Thanks

A: 

If you have your own table. Cck and views won't be much help to you. However you can still do db_query to get the data and theme_table will help you display. From the docs it looks like theme table will do some sorting for you but I haven't tried this.

Jeremy French
I may be able to integrate it into drupal. I have to do an insert into the table at various times (to add new meetings to the db). Would it be a better solution to create the content type in drupal and then insert the data manually whenever there are updates to be made? This way, I can take advantage of filtering views.
czuroski
See answer on import and table wizard. Looks like you want to import.
Jeremy French
+1  A: 

You might consider youing the table wizard project to incorporate this data into drupal. http://www.lullabot.com/articles/drupal-data-imports-migrate-and-table-wizard

It allows you to view the data and import it into your drupal project very easily.

mirzu
+1  A: 

Views will handle any data manipulation (like filtering and sorting) you might want to do; and Views 3 can utilize any backend datasource (previously, you needed to use Drupal's database). If you want this to be robust and not a one-time import, Views is likely the way to go.

The trick is going to be learning the Views API and writing the module. The API documentation is stored in the Advanced Help module; in addition to that, you'll need to learn how Views 3 handles third-party datasources. There isn't any documentation yet (Views 3 is still in Alpha) but if you look at Apache Solr Views (which uses Solr as a backend) and Extendr (which uses Flickr as a Views backend) you can parse how they're doing it. Extendr is more geared to proof-of-concept, so it might be easier to parse.

Mark Trapp
I will be loading the data into the database at regular intervals. I haven't yet tied into any specific datastore, so would it be best to create the content types using cck, and then just keep loading the new data directly into the mysql drupal tables that are created by the cck?
czuroski
That'd be the easiest (and the CCK field tables are relatively easy to understand), but at least in Drupal 6, CCK fields are attached to nodes, so hopefully that paradigm makes sense for your use case.If it doesn't, you can use your own tables with Views (2 and 3) as well; just use the documentation to describe the data to Views. This isn't too hard: you just need to implement a couple of hooks and create an associated array.
Mark Trapp
Just noting that views 3 isn't stable yet. So you may want to hold off heavy development for a bit.
Jeremy French
If you don't have an existing datasource you need to use and are able to use Drupal's database, you don't need Views 3. Views 2 works just fine and is stable.
Mark Trapp

related questions