Hi,
I have a node-customtype.tpl.php for each of many different content types. I've looked over my site and it appears as if they're all working fine except for one of the content types, where the "submitted" info isn't appearing:

submitted by USERNAME | date submitted

i have altered other things in the tpl.php file to confirm it's indeed working for the content type in question, but it still isn't printing the submitted info. is there some other place i should be looking where this might be disabled? i didnt see anything under the specific content type settings.

here's the tpl.php file (which works for SEVERAL different content types, just not one of them):
(Framework theme)

// $Id: node.tpl.php,v 1.1.2.24 2008/10/11 21:48:14 andregriffin Exp $
print $node->nid; " class="node if ($sticky) { print ' sticky'; } if (!$status) { print ' node-unpublished'; } ">

print $picture

if ($page == 0):

print $node_url " title=" print $title "> print $title print extra_voting_forms_show_form($node,'n' ,3)

endif;

if ($submitted):
print $submitted;
endif;

print $content

if ($links||$taxonomy){

/* if ($links):

endif; */

if ($taxonomy):

print $terms

endif;

}

Comments

wrb123’s picture

i tried copying node.tpl.php directly to node-customtype.tpl.php and i have the same problem where the tpl.php is working for the specific content type, but still doesn't show the "submitted" info

wrb123’s picture

also just placing print $submitted; in the .tpl.php file shows nothing, yet putting print 'text text text' prints "text text text".
is there a chance submitted-by and submitted-date info is not getting saved for this content type for some reason?

icstars’s picture

i have the same issue, and have double checked the DISPLAY POST INFORMATION ON checkboxes, and have reset them multiple times. i have also removed all node-type.tpl.php files. for whatever reason, one content type shows the user pictures and the rest do not. very strange.

i have imagecache_profiles.module installed.

using $picture does not work, but using this code in my node-type.tpl.php files does get the images to show up on all the content types that i want:
print theme('user_picture',user_load(array('uid'=>$node->uid)));

additionally, we have a need for more granular control over the preset size to use depending on the context and content type. for this reason, i have modified the phptemplate_user_picture function within imagecache_profiles.module to take advantage of the $size parameter that was being ignored.

function phptemplate_user_picture($account, $size = NULL) {
  if (variable_get('user_pictures', 0)) {
  	if (!$size){ //new if statement - if size is passed in as a parameter, no need to hit the db to find out what size to use
	    if (variable_get('user_picture_imagecache_profiles_default', 0)) {
	      // Define default user picture size
	      $defaultquery = db_query("SELECT presetname FROM {imagecache_preset} WHERE presetid = '%s'", variable_get('user_picture_imagecache_profiles_default', 0));
	      $size = db_result($defaultquery);
	    }
	    // If on user profile page
	    if (arg(0) == 'user' && is_numeric(arg(1))) {
	      if (variable_get('user_picture_imagecache_profiles', 0)) {
	        $query = db_query("SELECT presetname FROM {imagecache_preset} WHERE presetid = '%s'", variable_get('user_picture_imagecache_profiles', 0));
	        $size = db_result($query);
	      }
	    }
	    // If viewing a comment
	    if ($account->cid) {
	      if (variable_get('user_picture_imagecache_comments', 0)) {
	        $query = db_query("SELECT presetname FROM {imagecache_preset} WHERE presetid = '%s'", variable_get('user_picture_imagecache_comments', 0));
	        $size = db_result($query);
	      }
	    }
	}
...snip

i can then call it like this within my node-contentype.tpl.php files (notice user_full parameter):
print theme('user_picture',user_load(array('uid'=>$node->uid)), 'user_full' );

Tiburón’s picture

Have you explicitly told Drupal that it should show submitted by information on your custom node type?

On your site go to admin/build/themes/settings and check the box beside the name of you custom content type under the heading "Show information".

Regards,

Christian Larsen

wrb123’s picture

It worked!
Thank you so much. I had looked at that page before, but since I was on my blackberry instead of a computer those checkboxes were not showing up. Thanks!
-Bill