Jump to content

Sanitizer pageName (and Translations?)


stefan
 Share

Recommended Posts

Hi folks,

this question based on http://processwire.com/talk/topic/5414-selector-find-page-reference-help/?p=52292

I have added a few lines to the configuration of the module "pagename". Especially for the German umlauts ("ö" > "oe"...). 

By Admin > /filter/groessen
Great.
 $sanitizer->pageName('Größen',true) > "grossen" 
Wrong.. should be "gr*oe*ssen".  What is the secret here?
After a look around the Sanitizer::pageName method, i realized that the second argument isn't only a boolean value. The second argument should be "2" (constant "translate").
$sanitizer->pageName('Größen, Sanitizer::translate); // "groessen"
 

Is this dependent on a special thing (multilanguage support?) or just forgotten in the documentation (/api/variables/sanitizer/)?

Thanks. 

Adios, Stefan

Link to comment
Share on other sites

It would be correct:

$sanitizer->pageName("Größen", Sanitizer::translate);

No it's not dependent on special thing. It's used to translate titles to the name. Nothing to do with translations. This was added at some point around 2.3 after lots discussion and isn't documented on API section (yet) but on cheatsheet http://cheatsheet.processwire.com/?filter=pagename.

  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...