This is hopelessly confusing for me, so I'm hoping to network with someone who has already done something similar and can tell me how to get started. I essentially need to know two things:

1. How to set up my database tables

2. How to plug them into Drupal and start displaying data

I already have a working model online at www.geozoo.org/stacks/ Type in www.geozoo.org/stacks/Animalia/ and www.geozoo.org/stacks/Canis/ while watching the navigation links at the top of the page and the list of names in the column on the right.

It works almost perfectly, except that I don't know to deal with names that consist of two or more words or names that are drawn from two or more fields.

Thus, the links on the names in the right column at www.geozoo.org/stacks/Canis/ don't work. A species - like leo, at www.geozoo.org/stacks/leo/ - can't distinguish between the lion (Panthera leo) and the marsupial (Antechinus leo). So I want to display species with BOTH names - www.geozoo.org/stacks/Panthera_leo/

So, if you've done something similar, I'd like to first ask how to set up my database tables. I'm currently drawing all my information from one table with a child-parent relationship, like this:

NAME | PARENT
Animalia | (NULL)
Mammalia | Animalia
Carnivora | Mammalia

To mimic your strategy, do I need to create a separate table for species, separate tables for each taxonomic order, etc.?

Once I've accomplished that, how do I connect Drupal to my tables and display data? Can you point me to a tutorial that discusses this?

Also, I've been able to make a "modified preorder tree traversal" script that works. Is this something that's built into Drupal?

Thanks.

Comments

robertdouglass’s picture

Hi David,

I'm going to venture a guess that nobody is going to really be able to help you based on this post since it is hard to pinpoint what the question is; since I read your previous posts here, I'm a bit more "on the same page", so I'll try.

1. How to set up my database tables

2. How to plug them into Drupal and start displaying data

For 1, have you decided whether you are going to follow the suggestion that you create terms and vocabularies with Drupal's taxonomy system? Or are you going to try to write custom code to interface with your existing tables?

For 2, there is no "plug my table into Drupal and display data" feature; you have to write php code.

If you're going to use your own tables (not convert them to taxonomy terms), then you should be thinking about writing a module - that's the best way to go about extending Drupal in this way. For that you can define a second database connection in settings.php and use the Drupal database API to access it.

But I still maintain that you are doing classical taxonomy/hierarchy stuff, and that your data is well suited for being imported as vocabularies and terms into the Drupal category system.

Hope I'm not missing the point of your questions =)

- Robert Douglass

-----
Rate the value of this post: http://rate.affero.net/robertDouglass/
I recommend CivicSpace: www.civicspacelabs.org
My sites: www.hornroller.com, www.robshouse.net

DavidB’s picture

OK, thanks. That fills in a few more blanks. It sounds like it isn't quite as automated as I thought. I'd really like to network with someone who has done what I'm attempting to do, so I can follow their lead, as this is awfully confusing. The best guide I've found so far is the Animal Diversity Web, which uses Plone, which in turn uses alien technology. :)

But I'm going to spend a couple more days mulling this over. It sounds like it might be easier to make my own CMS after all (I just found a way to cheat on my database. ) :) I'll spend a few more days playing with Drupal, and see if I can figure any of this stuff out.

Thanks for your time.

robertdouglass’s picture

Depending on what you want and expect from your CMS, it probably isn't a good idea to make your own.

If all you want is a way to display your animal data, you don't need *any* CMS - just a bunch of scripts that grab data, format it, and shoot it off ot the browser.

I imagine you'd want to use Drupal if there are 500 scientists with animal data that you want to get into the database and the best way to go about that is a web application. Every time they make a post they need to select the right taxonomy for the critter they're talking about so that it gets categorized correctly. This is a case where Drupal would shine and learning to use it properly is worth your while.

If all you need to do is build some menus based on Kingdom/Phylum etc, then you can do that with a custom script and no CMS.

How interactive is your site supposed to be? Are people going to be able to sign up for user accounts? Do you want RSS feeds so that people can subscribe to all changes made to the homo sapien category? Can people leave comments? Should a spam filter be applied to the comments? Are there going to be file uploads? An image gallery? These are things Drupal does well.

Tip: Try telling us *exactly* what your site is supposed to do? For all the questions and even the glimpse I had of the link in this post, all I really know about your site is that you have a list of animals and their classification. Is that it?

- Robert Douglass

-----
Rate the value of this post: http://rate.affero.net/robertDouglass/
I recommend CivicSpace: www.civicspacelabs.org
My sites: www.hornroller.com, www.robshouse.net

robertdouglass’s picture

Why not bulid your taxonomy and your URLs in such a way as to be able to navigate the ENTIRE animal and plant kingdom just by manipulating the URL?

Example:
Animalia > Chordata > Mammalia > Dasyuromorphia > Dasyuridae > Antechinus > Antechinus leo

Here's your kitty. Here are the various URLs that could come from him:

http:site.com/animalia
http:site.com/animalia/chordata
http:site.com/animalia/chordata/mammalia
http:site.com/animalia/chordata/mammalia/dasyuromorphia
http:site.com/animalia/chordata/mammalia/dasyuromorphia/dasyuridae
http:site.com/animalia/chordata/mammalia/dasyuromorphia/dasyuridae/antec...
http:site.com/animalia/chordata/mammalia/dasyuromorphia/dasyuridae/antec...

That way you coul pop into the mammal world by going to animalia/chordata/mammalia, and the database would know just what to look up based on the URL. People with knowledge about a species would love it and so would search engines. If you wanted to have shorter URLs for some or all animals you could alias the URLs so that
http://site.com/lion
was a synonym for
http:site.com/animalia/chordata/mammalia/dasyuromorphia/dasyuridae/antec...

This is possible to program (in PHP) with Drupal. It would take an experienced Drupal programmer a day. They'd look at your data, and write a module with a fancy hook_menu that took all the various parts of the URL and constructed a db lookup based on them.

- Robert Douglass

-----
Rate the value of this post: http://rate.affero.net/robertDouglass/
I recommend CivicSpace: www.civicspacelabs.org
My sites: www.hornroller.com, www.robshouse.net