Some of my menu items say things like:
"Site Map & Search"
In older releases, this was OK.
In 0.13, it's OK in the CSSMenu, but displays literally "&" in the breadcrumb trail, and in the page title.
Any ideas?
Thanks!
& in breadcrumbs and page titles
Re: & in breadcrumbs and page titles
OK, I've made a one-line patch to lib/misc_functions.php which fixes this problem for now.
The 0.13 code is trying to be helpful by escaping "&" signs automatically, but it doesn't do that in the CSS Menu or in the Site Map. The best thing is to use "&" yourself in menu text and page titles, but if you do that, then the automatic code messes things up...
Here's the patch, to un-do the change when it's not wanted. It's just the last line of this block:-
The only snag with this is that you now can't have a page that literally displays "&". I can see this being a pain if you write a site about web design. So it would be better to sit down and fix the actual problem if possible. This is just a quick bodge for now.
The 0.13 code is trying to be helpful by escaping "&" signs automatically, but it doesn't do that in the CSS Menu or in the Site Map. The best thing is to use "&" yourself in menu text and page titles, but if you do that, then the automatic code messes things up...
Here's the patch, to un-do the change when it's not wanted. It's just the last line of this block:-
Code: Select all
function my_htmlentities($val)
{
if ($val == "")
{
return "";
}
$val = str_replace( " ", " ", $val );
//Remove sneaky spaces
// $val = str_replace( chr(0xCA), "", $val );
$val = str_replace( "&" , "&" , $val );
$val = str_replace( "&" , "&" , $val ); # This is the new line