1

A few of our content pane titles need to be italicized because they contain book titles.

I've added an "italicize-title" class to the content pane in Panelizer > Content > Content Pane > CSS properties. This has some drawbacks. The main disadvantages are that the whole title is italicized and I have to manually add the class to each piece of content needing its title italicized.

I've tried the HTML Title module, but that didn't work.

Is there a way for me to allow content editors to use a limited number of html tags in a content pane's title field?

Thank you for looking...

0

This is untested but I would try implementing a template_preprocess_panels_pane():

function mytheme_preprocess_panels_pane(&$vars) {
  $content = &$vars['content'];

  $title = !empty($content->title) ? $content->title : '';
  $title = preg_replace("/\*\*(.*?)\*\*/", "<b>$1</b>", $title);
  $title = preg_replace("/\*(.*?)\*/", "<i>$1</i>", $title);

  $vars['title'] = $title;
}

Adapted from this answer, and would allow some simple markdown in the titles.

  • This isn't working, unfortunately. It just displays the **Hello** World verbatim instead of replacing it with the <b> tags. – user981023 Mar 21 '13 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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