rooofl Posted June 8, 2020 Share Posted June 8, 2020 I need to find the sinitizer used to generate page names from page titles. I found $sanitizer->pageName() but it seems to ignore special characters: With $sanitizer-> pageName(), raphaël becomes raphal, however in the PW back-end the page title raphaël becomes raphael. Any idea what I should use instead? Link to comment Share on other sites More sharing options...
kongondo Posted June 8, 2020 Share Posted June 8, 2020 Maybe try these? https://processwire.com/api/ref/sanitizer/page-name-translate/ https://processwire.com/api/ref/sanitizer/page-name-u-t-f8/ 1 Link to comment Share on other sites More sharing options...
iank Posted June 8, 2020 Share Posted June 8, 2020 Also, $sanitizer->pageName("raphaël", true) produces raphael. The second param being $beautify, which according to the docs: "Because page names are often generated from a UTF-8 title, UTF-8 to ASCII conversion will take place when $beautify is enabled." 2 Link to comment Share on other sites More sharing options...
kongondo Posted June 8, 2020 Share Posted June 8, 2020 10 minutes ago, iank said: The second param being $beautify, which according to the docs: True. $sanitizer->pageNameTranslate() is just a proxy for Sanitizer::translate option for the $beautify argument ? 1 Link to comment Share on other sites More sharing options...
rooofl Posted June 8, 2020 Author Share Posted June 8, 2020 Great! $sanitizer->pageName("raphaël", true) does the trick indeed. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now