views:

150

answers:

2

I'm new to extending Drupal, though I've done similar kinds of things for other CMSes. Anyone care to share opinions on the best way to access an external API from within Drupal?

I need to show things like search results, listings, and listing summaries. In my reading up on Drupal, I think this implies I need to create both "nodes" and "blocks". Is this right? It wasn't clear to me from the module tutorial if this is possible from within the same module.

Thanks for any help / suggestions!

UPDATE: I found the Stock API module which does a simple case of what I'm trying to do. I'll model my module after that one.

+2  A: 

Yes, they are all possible from within the same module; consult the various hook functions on how to declare nodes and blocks in a function.

There's also the PHP filter, which lets you embed pure PHP code on content pages, and doesn't require any module development, but for anything non-trivial I cannot recommend it.

Edward Z. Yang
+1  A: 

Andrew - generally, you will want to put any kind of non-trivial code in an external module. With the exception of display code, which should be put into the template.php file associated with your theme.

If you care to describe your project in greater depth, I may be able to make more useful suggestions.

BrianV