Jump to content

returned page title with this> - <inside ?


Recommended Posts

Posted

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?

Posted

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.

Posted

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 !

Posted

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

  • Like 1

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
  • Recently Browsing   0 members

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