url_alias of user profiles with nickname

Author Message

Michael Fürst

Thursday 21 May 2009 12:02:01 pm

Hi,

I've a small problem:
The URL to the user profiles look as follows at the moment:
<b>www.domain.com/Users/Registered-users/Mike-Meiers</b>

As you can see, the <first_name> and <last_name> is used to identify the object (Mike-Meiers). Due to data protection I want to change the url_alias to ../<login_name>:
<b>www.domain.com/Users/Registered-users/Mikesnickname</b>

When I change the url_alias setting of the user class I've two problems:

1) URL alias of existing users don't change
2) I don't know how to get the login-name (normally <first_name> <last_name> is set). And the user name is a sub-item of <user_account>.

Maybe anyone can help me? Is there a job that regenerates the url_aliases?

Ciao,
Mike

Ivo Lukac

Thursday 21 May 2009 12:33:16 pm

Mike,

For urls to update you need to run updateniceurls script from command line:
php bin/php/updateniceurls.php -s your_siteaccess

For second issue I don't know exactly the solution (didn't try it myself) but you will see when you run the script what will be the result.

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Michael Fürst

Thursday 21 May 2009 3:53:19 pm

Hi Ivo,

Thanks, that was the right script :)
Here is the solution (if someone else has this problem):

1) Change URL-alias name of class "user" to <user_account>
2) Run bin/php/updateniceurls.php -s <site> script

Then you'll have the following URL:
<b>www.domain.com/Users/Registered-users/Mikesnickname</b>

Thanks Ivo,
Good night,

Mike

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.