Jump to content

non-alphabetic page name


LeiHa
 Share

Recommended Posts

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

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

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

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/]*$"
  • Like 2
Link to comment
Share on other sites

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 :)

  • Like 2
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...