By Cosmy on
Hello.
I'd like to delete the author from the "submitted" string. The content of the variable $submitted should be only date and hour, but i'm not able to do it from the administration.
What can i do?
Hello.
I'd like to delete the author from the "submitted" string. The content of the variable $submitted should be only date and hour, but i'm not able to do it from the administration.
What can i do?
Comments
You can override the
You can override the variable in the template.php of your theme, specifically in the function _phptemplate_variables. Have a look at
http://drupal.org/node/16383
The same mechanism applies for overriding existing variables.
Alternatively you could just delete the $submitted printout from your node.tpl.php and insert something like
<?php print format_date($node->created, 'small')) ?>See http://api.drupal.org/api/function/format_date/5
Great it works. But if i
Great it works.
But if i want to use the format_date in template.php to override the $submitted variable that is the code:
function _phptemplate_variables($hook, $vars) {
switch($hook) {
case 'node' :
$vars['submitted'] = format_date($vars['node']->created, 'small');
break;
}
return $vars;
}