On certain themes one might wish to display the date the node was submitted on with a different format.
So far I've managed to this by hacking the PHPTemplate engine, with something like this:

if (theme_get_setting('toggle_node_info_' . $node->type)) {
    $vars['submitted'] =  t('Submitted by %a on %b.', array('%a' => format_name($node), '%b' => format_date($node->created)));

// Adding this line to the original phptemplate.engine
    $vars['myDateFormat'] = format_date($node->created, 'custom', 'F d, Y');
}

However it'd be really nice if PHPTemplate offered a way to do this on a theme-per-theme basis, without the need of hacks.

Comments

adrian’s picture

This should be a feature of the theme system itself, not PHPTemplate.

There is nothing stopping you from using

<?print format_date($node->created, 'custom', 'F d, Y'); ?>

directly in your template, instead of passing the variable to the template.

Anonymous’s picture