2

I have used custom breadcrumbs module.

Now one of my title of blog has single quote or double quotes, which is having problems.

So, in titles i have added

[node:title]

so output of the title whose having quotes are like

Home > blog > Politics > No Democracy but many other 'o-cracies'

and i have added hook which will show the output is like this..

function myowntheme_breadcrumb($variables) {
    $sep = ' > ';
  if (count($variables['breadcrumb']) > -1) {
    return implode($sep, $variables['breadcrumb']);
  }
  else {
    return t("Home");
  }
}

How to remove that hash tag values and show on simple version ?

1 Answer 1

4

Your nodes contain apostrophe in their title. Node titles will be passed through check_plain() function and it uses htmlspecialchars() function to convert the quotes to HTML entities.

You may try by decoding them back

function myowntheme_breadcrumb($variables) {
    $sep = ' > ';
  if (count($variables['breadcrumb']) > -1) {
    return htmlspecialchars_decode(implode($sep, $variables['breadcrumb']),ENT_QUOTES);
  }
  else {
    return t("Home");
  }
}
1
  • thank you... Many time, you have to think simple to do simple thing.. :)
    – Nitz
    Commented Oct 31, 2012 at 12:20

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.