Hi,

I'm trying to find up to date documentation on the Node object. So far I've found this page:

http://drupal.org/node/49768

which seems to contain the information that I'm after. However, this is located in documentation for Drupal 4.6, and the tag at the top right also confirms this as "4.6.x".

Is this current information? If so, how do I know (as someone who is starting out on Drupal with version 6) which documentation is correct, and which has been deprecated due to new features? Or should I assume that everything documented for versions 4 and 5 also applies to 6 as well?

Thanks for any help you can give :)

Andy

Comments

gpk’s picture

If you use Contemplate or Devel themer modules they will show you the entire node object.

Or you can use

print '<pre>';
print htmlspecialchars(print_r($node, TRUE), ENT_QUOTES);
print '</pre>';

gpk
----
www.alexoria.co.uk

fxnut’s picture

Thanks for your reply.

Does that mean that it's not documented for version 6 then? Are the various properties of the object explained somewhere?

A

gpk’s picture

>Does that mean that it's not documented for version 6 then?
The short answer is "I don't know"! There may be something but I've not seen it.

This may also help: http://drupal.org/node/11816. And with a bit of intuition you can probably work out most of the rest. I expect there's info in here too http://www.amazon.com/Learning-Drupal-6-Module-Development/dp/1847194443....

gpk
----
www.alexoria.co.uk

fxnut’s picture

Cool, thanks for that first link, that gives me a good place to start. I'll check the book out too.

I guess I'm finding that the docs are a bit lacking in some areas. A lot of essential information seems to be scattered in lots of different places. Trying to pull it all together as a beginner to Drupal is really tough. Some of the handbooks are really helpful, but the reference API could certainly do with a bit of a boost.

I'm finding that there's a lot of common knowledge which is assumed. For example, in hook_view(), it says something like:

"If for some reason you need to change the body or teaser returned by node_prepare(), you can modify $node->content['body']['#value']."

This is great info having this hint here, but there's no way (that I've found) to track down more related information on this. The link I found (and the one you supplied) mention the content variable, but there's nothing to document the 'body' or '#value' keys to the arrays. I don't mind a bit of investigation using print(), but this stuff seems pretty fundamental to Drupal, and I'm quite surprised that it doesn't seem to be in the docs.

Anyway, I hope this isn't coming across as a rant, because it's not supposed to be. I'm just hoping that someone involved in the documentation will take notice and bare it in mind for future work.

In the meantime, if you (or anyone else) has any hints about the best pages to look at to gain this common knowledge, I'm all ears!

Thanks again.

Andy

gpk’s picture

>A lot of essential information seems to be scattered in lots of different places. Trying to pull it all together as a beginner to Drupal is really tough. Some of the handbooks are really helpful, but the reference API could certainly do with a bit of a boost.

Well yes it is a bit of a challenge to document a continuously evolving product, and even harder for a beginner to find their way round. A textbook provides the kind of overview that you won't ever find on in the handbooks (not yet at least) or on the api site. The latter is really meant as a reference rather than documentation of how to do stuff, though it does have a few different topics/examples as you will have seen. For some clever people though the code *is* the documentation ;)

gpk
----
www.alexoria.co.uk