Drupal: Allow HTML in node title

<?php
 
/* 
 * This function generates the variables that are available in your node.tpl,
 * you should already have this in your template.php, but if not, create it.
 */
function mytheme_preprocess_node(&$vars) {
    // It's important to run some kind of filter on the title so users can't
    // use fx script tags to inject js or do nasty things.
    $vars['title'] = filter_xss($vars['node']->title);
}

Source: http://goo.gl/mUBcPj

Leave a Reply

Your email address will not be published. Required fields are marked *