Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

$MenuTitle with HTML entities


Go to End


2310 Views

Avatar
BobRock

Community Member, 15 Posts

3 September 2013 at 8:04am

When $MenuTitle returns to a template and contains HTML entities, those entities are rendered a literals instead of HTML. So

<h2><a href="$Link" title="<% _t('VIEWFULL', 'View the full post titled') %> '$Title'">$MenuTitle</a></h2>

returns as: Just An Example&#8217;s Post

instead of as: Just An Example’s Post

I used SmartyPants to filter the MenuTitle() function's return value like this:

return SmartyPants($this->getMenuTitle());

Why is that? And how can I fix it?

Bob