Dodanie alternatywnego tytułu do węzła w Drupalu
Załóżmy, że chcemy mieć możliwość wstawiania do tytułu węzła htmla. Wystarczy, że nadpiszemy funkcję template_preprocess_node.
function nazwamodulu_preprocess_node(&$variables)
{
$node = $variables['node'];
$variables['title_html'] = check_markup($node->title);
}
Następnie w templacie możemy już się odwoływać do zmiennej $title_html.
