Hello I need to insert a formated date in a block template: block--delta-blocks--page-title.tpl.php
As I think this can be done using a preprocess function to set the $day, $month, $year variables:
function cybele_preprocess_block(&$variables) {
$variables['day'] = format_date($node->created, 'custom', 'd' );
}
But it seems $node->created is not visible here. It works if I place it in:
function mytheme_preprocess_node(&$vars) {
$node = $vars['node'];
$vars['year'] = format_date($node->created, 'custom', 'Y' );
$vars['month'] = format_date($node->created, 'custom', 'm' );
$vars['day'] = format_date($node->created, 'custom', 'd' );
}
but not in _preprocess_block function. Can someone help me do that? Probably I need to declare in mytheme_preprocess_page but the block template won't see from there either.