I am trying to print the comment form and comments at the bottom of my custom node template but have been unable to do so and I can't find any solutions that work. Does anyone have any ideas?

Comments

designwork’s picture

Hi hostdp6,

can you post your tpl.php code here to review and tell me wich drupal version you are using!

Cheers

Dirk

hostdp6’s picture

I'm using Drupal 6.14, here is my code, thanks.

rschwab’s picture

Don't forget <code> tags.

- Ryan

hostdp6’s picture

Sorry, I am new at this and am clearly doing something wrong. This is what appears when I use the code tag. Do you know what I am doing wrong or is there a way for me to just atach the php file?


	// Grabs the firsts image path and sets $imagePath.
	$imagePath = $node->field_image_cache['0']['filepath'];

<div id="node">

	<h2> print $title </h2>
    
    <div id="product-node-left">
        
        <div id="product-node-image-main">
        	<img src="http://dev.statusbro.com/ print $imagePath; " alt="Title">
        </div>
        
        <div id="product-node-image-thumb">
        	<ul class="other_imgs">
			   
                       // get all images
                        foreach ($node->field_image_cache as $images) {
                    
               <li><img src="http://dev.statusbro.com/sites/default/files/ print $images['filename']; " width="90" height="67" alt=" print $images['alt']; "></li>
                   
                    }
                    
            </ul>
        </div>
        
        <div id="product-node-attributes">
        	<p class="price"><span class="label">price: </span> print uc_currency_format($node->sell_price); </p>
        	 print $node->content['add_to_cart']["#value"]; 
        </div>
        
    </div>
    
    <div id="product-node-right">
    	 print $node->content['body']['#value'];  
    </div>
    
    <div id="product-node-bottom">
		
		
	</div>

</div>

edited by silverwing - fixed code tag closure

designwork’s picture

Hi hostdp6,

is this the complete code of your tpl.php file? Anyway put at the end of your tpl.php file this command print_r($node);

In your content type settings admin/content/types choose your content type and in the comment section under Location of comment submission form: choose Display below post or comments.

when you go to your node now you see a long array of the node object. Get the value for your comment form and print it under your $node->content['body']['#value'];

Cheers

Dirk

hostdp6’s picture

Got it. You're the man, thanks.