Hi,
I have some page titles that have "&" inside them and the w3.org validator gives me warnings.
How can I force the pagetitle to be automatically change to something valid
Thx
you need to manualy repce it with & ore make a plugin that replaces & with & on saving doc or prerender the document.
dimmy
Tick tools->configuration->site->XHTML URLs: "Yes"
Replaces ampersand (&) characters in urls that are generated by MODx with the validating & htmlentity
-
☆ A M B ☆
- 24,524 Posts
He’s not talking about URLs, he’s talking about the pagetitle, like Research & Development. Either use & in the pagetitle field, or make a plugin. The plugin would have to be coded to only convert bare &, though, otherwise you might end up with & if there were any already encoded.
If it is only for pagetitle it does not need to be a plug-in, it could also be a snippet or a PHx modifier to be used directly on the variable output. If it was content wide then a plug-in would be needed.
Thx guys,
I am kind of busy right now but I’ll let you know what I decide.
Probably I will build a plugin that will change the page title to a valid one. Shouldn’t be that hard using the htmlspecialchars function
I need the same thing since I know that my client won’t bother with writing & in the title field. Not really sure how to fix it with a plugin though...
That didn’t seem to do it for me. Maybe I’m doing it wrong? I installed it as a plugin and checked OnWebPagePrerender. Anything else I might’ve missed?