0

I have a menu link whose link title contains a character entity (e.g. La Niña). However, Drupal isn't recognising the character entity and is further encoding the ampersand, so I'm ending up with La Niña. How do I fix that?

Bobby Jack
  • 15,689
  • 15
  • 65
  • 97

1 Answers1

3

You can override themable output in your theme template.php file or in a custom module.

Basicaly, the point is that the l() function isn't called with the "html" option in theme_menu_link

See http://api.drupal.org/api/drupal/includes--common.inc/function/l/7 and http://api.drupal.org/api/drupal/includes--menu.inc/function/theme_menu_link/7

Mattlc
  • 81
  • 2
  • Perfect - works like a dream. Thanks for such a quick and thorough answer. – Bobby Jack Feb 16 '11 at 17:25
  • 1
    Be aware that just adding the html option can be a security risk if other users can add menu links. – Berdir Feb 16 '11 at 18:35
  • @Berdir - good point. I did mean to add a note here to the effect "That works perfectly, but I guess I need to fix the root problem". Would you recommend NOT having entities in the menu link text? I.e. use the unicode character instead? – Bobby Jack Feb 16 '11 at 18:38
  • I think so, yes. Have you tried if Drupal already converts them? Probably not but if you really want it as an character entity, you could replace them in that theme function. – Berdir Feb 16 '11 at 19:02