LeiHa Posted March 8, 2013 Share Posted March 8, 2013 Hi guys. I've been having a good time learning php code and Processwire API. Now that I got a problem which I have no idea to solve. Using everything written in English works fine. However I can't figure out to put non-alphabetic page name. On the description, page name has to be like this. Any combination of letters (a-z), numbers (0-9), dashes or underscores (no spaces). This means I can't put any letter other than those above. I'm using Asian letter. Asian letter has 2 byte in stead of 1 byte. Maybe that's the problem or not. If anyone of you can answer, that would be sweet. Thank you always. LeiHa Link to comment Share on other sites More sharing options...
Joss Posted March 8, 2013 Share Posted March 8, 2013 I am not sure if this will help. If you look at the title field in Setup > Fields, you will see that the HTML Entity Encoder is added on the details tab. Hmm ... not going to help the page "name", though Link to comment Share on other sites More sharing options...
SiNNuT Posted March 8, 2013 Share Posted March 8, 2013 Like you already mentioned page names can only be standard alphanumeric and dash, underscore and dot. What exactly is your question? InputfieldPageName attempts a character replacement. Maybe your character (which is it?) isn't listed? You can look this up if you go to Modules->Page Name (under the Inputfield section) and click on it. You should see a whole list, to which you can add your own if neccesary. Link to comment Share on other sites More sharing options...
Wanze Posted March 8, 2013 Share Posted March 8, 2013 Hi LeiHa, As far as I know, it's currently not possible to have Asian letters in the url. ProcessWire accepts only the characters mentioned in the description. This restriction is already fix in the .htaccess. Any url that doesn't match the criteria isn't routed through Pw: # ----------------------------------------------------------------------------------------------- # Ensure that the URL follows the name-format specification required by ProcessWire # ----------------------------------------------------------------------------------------------- RewriteCond %{REQUEST_URI} "^/~?[-_.a-zA-Z0-9/]*$" 2 Link to comment Share on other sites More sharing options...
teppo Posted March 8, 2013 Share Posted March 8, 2013 There's not much value to be added to answers above, just wanted to point out that currently URLs (and page names, which URLs are based on) ProcessWire allows follow generic URI syntax as defined by RFC 3986 -- mostly, as you can see from this excerpt from said RFC: Characters that are allowed in a URI but do not have a reserved purpose are called unreserved. These include uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde. unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" Only difference here is that the spec for URL doesn't say anything about tilde "~" having to be at the beginning of an URL, but ProcessWire seems to only allow it that way and thus prevents it from being used in page names. I'm not 100% sure if I'm reading the specification correctly, though.. Anyway, in order to use Asian characters in URLs you'd need to follow IRI specification (RFC 3987) which is simply international version of URI. According to HTML5 specification that's not a problem, since URL is valid if it's either valid URI reference or valid IRI and certain other conditions are met. So, I guess my point here is that currently PW doesn't allow out-of-the-box what was asked in the original post, but who knows -- perhaps at some point it will 2 Link to comment Share on other sites More sharing options...
LeiHa Posted March 8, 2013 Author Share Posted March 8, 2013 Okay. I guess I have to find out different way of doing it. Thank you, all of 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