I am creating a module which combines the data of a couple of modules (cck, taxonomy) with the standard node_type data (e.g. title of a node). I am able to display this in a block. Thanks to the excellent written tutorial.
What I can't figure out yet, and I am getting lost on is the following:
I would like to show the data (relevant cck fields, taxonomy, title node) from the module on the correct node dynamically.
Pseudocode:
if node_type = 'custom node_type'
if url = '?q=node/1'
then display 'node record with nid1 module output' in node.tpl.php
How do I do this?
So far the documentation I have read and/ or am searching through is:
Creating Drupal 6.x modules
Creating modules - a tutorial: Drupal 6.x
node_example.module
I know, for the most part, how to program a node.tpl.php, and writing the query shouldn't be a problem. The hook to load the module automagically into the node.tpl.php is eluding me. Do I for example use a 'echo custom_module_function()'? But then I would be bypassing the module, wouldn't I?
Thank you in advance for any advice.
Comments
*bump*
*bump*
Could you explain...
Could you explain what you're trying to do with a mini "user story" of how this would work and what a user would see?
From your pseudocode, it sounds like you want to create something that checks to see if a node is of some specific custom type, and if the user is the site's administrator. If both those conditions are true, then render the node with added information that other users do not see.
Is that what you want?
-Blake
www.BlakeSenftner.com www.3D-Avatar-Store.com
@bsenftner Thank you for your
@bsenftner
Thank you for your reply.
Correct, except for the administrator part,this is what I am trying to figure out in the first post.
What I am not sure about is whether I should use 'node-my-custom-node-type.tpl.php' or some kind of code illustrated above, such as 'if custom-node-type then'. Optimally I would like to use the second one ('if-custom-node-type') in the theme template file to use in a M.V.C. model with theming. So 'if' then 'include' 'this php file with a block of code or module function'.
Unfortunately I can't figure out how to add a function in a module to a theme, or if adding a function directly to a theme is the correct practice in the first place.
So module:
then in the theme?:
So basically what statement do I use to print the module function in the theme template file, in this case a node.tpl.php.
I hope this helps. Please let me know if you find anything unclear.
For more information in the form of writeup can be found here: http://groups.drupal.org/node/28424
I am trying to cover all the bases there.