Best practice for defining custom D7 node types

What is best practice for modules to create new node types in Drupal 7?

In Drupal 6, I have a module that uses hook_schema to define a new mymodule_node table on installation.
This table does nothing more than define the additional fields for my new node type, keyed by nid. I then use hook_load to load these fields in whenever a node of that nodetype is loaded, together with hook_update, hook_delete, hook_insert etc. to keep this table in sync with alterations to the underlying node. This is the same approach I used in D5 and works very well.

However, looking at the node_example in the "Examples for Developers" module, I notice that the approach now taken there is to use the Fields API to define the new node type in hook_install(), creating fields and then attaching them directly to a new node type using field_create_field, field_create_instance, etc. hook_schema is not used at all, and no new tables are created relating to the node type. Furthermore, all the view formatting has changed to define the widgets associated with each field etc.

Just wondered, what are the benefits of switching to use the Fields approach rather than hook_schema for storing custom node type information?

The node_example.module file has a comment
"We no longer need an external database table to store this content types information."

Displaying drupal content in a normal HTML website.

I just started using drupal and i like it so far but cant seem to find a way to do what i want. I am a web designer and i really don't want to have to take the time to make drupal look how i want. I want to build the web site outside of drupal, then pull in the content where ever i want. My client needs a photo gallery where she can log in and create albums and upload photos. She also wants a page with testimonials that she can add too her self.

Drupal and google buzz (Twitter/facebook thingie Google), what usefull things are possible?

Hi,
I like google buzz already after playing with it for a couple of days.

What could be the benefit to integrate google buzz and drupal site?
May be
- showing buzz-block on site (same as twitterblock)?
- integrate drupal site, so a node can be exported to a google buzz
- same sort functionality as facebook/twitter drupal modules.

Just starting this thread to think about the great advantages of drupal and google buzz together!

Greetings,
Martijn

Problems with comment form

Hi,

I can't seem to get my comment form to work the way I want it. As it is drupal requires people to have a user account before commenting, or if not comment anonymously. I would like to have a Name, email, and website form like a normal blog. I tried installing the concise comments module to see if that would work, but it hasn't altered the comment form at all - I don't know what's going on.

My site is www.andrewgubb.com.

Thanks.

Andrew

London Based Drupal Developer needed

Hello Drupal developers,

We are a New Media agency based in Old Street, London.
We are looking for an experienced freelance Drupal developer to work on a big upcoming project.

This will involve setting up and building a Drupal powered site from scratch, installing and creating/customising modules.
The project has some social networking features.

We would like candidates to be able to work in our office for at least some of the time.

Secure Pages needs more information

So I've got an online store using Drupal and Ubercart and I've just installed Secure Pages module - http://drupal.org/project/securepages.

There was a forum a while back about how you need to do things before you can use this module, but with no instruction about how to do it or even what it means. See http://drupal.org/node/327805.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x