OK,

Sorry in advance for my newb. question.

Tonight I've been looking for two things and I think I need more help knowing where to find stuff in the documentation.

1) I needed to know about the function taxonomy_node_get_terms() ... where is this stuff documented? I happened to see a reference to it in someone's forum reply, guessed that it returned an Array and used it from there. That's not the greatest way to discover stuff though. :) There's gotta be documentation on this stuff somewhere. What am I missing?

2) I need to have my theme change one piece of itself (a photo in the upper right corner of the page) based on taxonomy terms. With that function above, I'm almost there. BUT, how do I know the node id of the page I'm currently on?

That is, in page.tpl.php, I want to say "taxonomy_node_get_terms( $this_pages_id )" and then use that to determine the photo to display. I've got it all working except knowing how to get the ID of the page. Isn't there some documentation somewhere that shows me how to do stuff of this general nature?

I'd love to see:
A) Full documentation of taxonomy_* functions
B) How to see where the stuff is all set for the theme's access. I found a list of vars (e.g. $title, $head, $content, etc.) in the PHPTemplate Engine handbook, but I haven't seen how that stuff's all set.

What am I missing?

Comments

styro’s picture

are here http://drupaldocs.org . Note it can still take some intuition to figure out return values sometimes though.

eg:
http://drupaldocs.org/api/4.6/function/taxonomy_node_get_terms

Not sure if you already knew that or not though.

--
Anton

suydam’s picture

Thanks!
That's a huge help!

Here's another question.

I searched drupaldocs for $node-> (hoping to see what vars are available there)

Where is that stuff documented?

Thanks

styro’s picture

Last time I looked (nearly a year ago) there wasn't any concrete documentation about what those objects (eg $node, $user etc) contained. There might very well be some docs now though.

Back then, I just browsed through the code on drupaldocs and looked at the table fields until I found what I wanted. It wasn't ideal, but it wasn't actually as daunting as I thought it would be.

--
Anton

geodaniel’s picture

I'm not sure about docs for the node object, but if all you want to do is see what's being stored in there, you could always do a print_r($node) in the code you're working with to print the variables to the top of the page you're looking at.