I'm writing a module that creates my own custom content type. I'm trying to figure out how to make a block of text appear on the right sidebar of the page (as instructional text) alongside the field that I am generating?

Comments

lukey’s picture

The node template file (node.tpl.php) file which will be processing your node I do not believe will be "aware" of the right side bar. They are outputted in different areas. I'm not sure of the best way to do this, but if you wanted something quick and easy you could just make a block and use the PHP input filter to detect what node's page you are on and output the relevant data there.

It is hard to visualize what exactly you are talking about without some more detail.

Are you wanting to output help text for several fields, or one set of help text for the entire node? Are you referring to the edit/new form to create or edit the node of your custom content type, or will the node have some sort of for on it in its "being viewed" state?

Maybe if you had a mockup of what you wish to accomplish it would help.

walker6o9’s picture

$right = 'click me';
drupal_set_content('right',$right);

Did what I was trying to do.

Grayside’s picture

Create a block with no content (or just enough to output the block's div structure). Add it to the right region.

Create a link that uses an ahah callback to insert your content.

This doesn't have much to do with your content type, it has to do with a carefully crafted link you want to add to pages of a given content type. You might look at how the flag module adds links to nodes.