I'm having trouble understanding hook_view. I've been searching around for a good example or blow by blow tutorial on it, but im yet to find anything. I didnt find the Basically ive created my own node type and when its being viewed id like to display an additional form set. All the examples i have found refer to a theme of some kind and which always seems to use statically generated HTML...

Any help would be appreciated..

Comments

wla_g’s picture

Hook_view is to display the data of your new node type. Your module defines a new node type. The view hook tells drupal, how to display the information from that node. That's all what it does.
You'll find the theming in the examples because most the display task require, that the display is done in a way to support the various themes.

Regards
Werner

Valdameer’s picture

Thanks for the reply, makes sense, but im still unsure of how to complete my goal, since the general aim here is to throw in some additional text fields with a submit button, kind of like a comment, but specific to this particular node type. Would i define this functionality in the _view, _form or _nodeapi hooks? or am i way off track.

Thanks again,
Vald

Valdameer’s picture

Sorry to be a bother, just the sooner i can get this done the better..

dutchslab’s picture

have you taken a look at this?

Valdameer’s picture

yes, but it doesn't give any instruction in deriving the functionality im trying to create. All i need it do is add something akin to a comment at the bottom of the nodetype. just a few text fields and a submit button that will write to the database i have created..

Valdameer’s picture

Am i even on the right track?

Valdameer’s picture

ok, so i added my new form to the node in the hook_nodeapi when the $op == 'view' except i want to restrict it to just this node type, whats the best way to do this, since all my attempts have yielded empty variables...

as always any help is greatly appreciated

dutchslab’s picture

try:

if ($node -> type == 'my_node_type') {

...

}

does that make sense?