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.

eZ debug

Timing: Jan 18 2025 16:06:22
Script start
Timing: Jan 18 2025 16:06:22
Module start 'layout'
Timing: Jan 18 2025 16:06:22
Module start 'content'
Timing: Jan 18 2025 16:06:22
Module end 'content'
Timing: Jan 18 2025 16:06:22
Script end

Main resources:

Total runtime0.0148 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.4766152.6406
Module start 'layout' 0.00510.0027 742.117239.4766
Module start 'content' 0.00780.0051 781.593889.3672
Module end 'content' 0.01290.0019 870.960934.3047
Script end 0.0148  905.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002617.3932140.0002
Check MTime0.00117.1934140.0001
Mysql Total
Database connection0.00085.424010.0008
Mysqli_queries0.002315.443630.0008
Looping result0.00000.074010.0000
Template Total0.001610.810.0016
Template load0.00096.186510.0009
Template processing0.00074.621310.0007
Override
Cache load0.00074.473410.0007
General
dbfile0.00064.312580.0001
String conversion0.00000.041840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs