If you put a backslash in a title of a node I need to rewrite that title and remove the backslash wrapping the text after in tags. I'm currently doing this using multiple preprocess functions. It seems that I have to create a new preprocess function for every context that a title might appear in:

function project_preprocess_page(&vars){/*rewrite*/}
function project_preprocess_node(&vars){/*rewrite*/}
function project_preprocess_node(&vars){/*rewrite*/}
function project_preprocess_panels_pane(&$vars){/*rewrite*/}

This is working but it's frustrating (and probably inefficient) as there are so many different contexts where titles are displayed.

It seems like there should be a function where I can just override this once and not worry about it anymore. Can anyone suggest a solution?


1 Answer 1


I'm sure hook_node_view can do it for you, but you might need to call drupal_set_title on some situations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.