bwakad Posted March 22, 2014 Share Posted March 22, 2014 Hello all, I am sure someone must had this before. I have a select field with options holding values from page titles. My page title/name is for example: "this is my page"; I use echo $page->fieldname->name and the value; the returned output is: "this-is-my-page". Is there somewhere an option I have to use to make it normal spaces? Link to comment Share on other sites More sharing options...
SiNNuT Posted March 22, 2014 Share Posted March 22, 2014 No, $page->name is used in the url of a PW page. Spaces are not allowed in a url. What you are probably looking for is $page->title. Link to comment Share on other sites More sharing options...
bwakad Posted March 22, 2014 Author Share Posted March 22, 2014 No, $page->name is used in the url of a PW page. Spaces are not allowed in a url. What you are probably looking for is $page->title. excellent my fellow country men ! Link to comment Share on other sites More sharing options...
SiNNuT Posted March 22, 2014 Share Posted March 22, 2014 No problem. Please note that ProcessWire (PW) automatically creates the name from the title you enter. You can see this on the settings tab of a page. Where you can also edit the name should the need arise. PW pagename creation in the admin follows these rules: all characters except for these ASCII characters: "a-zA-Z0-9_." (not including the quotes) are removed. It also truncates the length to 128 characters. Spaces are turned into "-". Uppercase is getting lowercased and letters like "é" or "ô" are turned into "e" and "o", so: title:Great Pagé ! -> name:great-page 1 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