Add a custom field to the user registration and profile page. This select will gather all the countries in the world from a simple database table.
plugins/user/profile/profiles/profile.xml:
name="country2"
type="sql"
id="country2"
description="PLG_USER_PROFILE_FIELD_COUNTRY2_DESC"
filter="string"
key_field="id"
value_field="name"
label="PLG_USER_PROFILE_FIELD_COUNTRY2_LABEL"
query="SELECT id, name FROM countrylist ORDER by name"
/>
plugins/user/profile/profile.xml:
< field name="register-require_country2" type="list" description="PLG_USER_PROFILE_FIELD_COUNTRY2_DESC" label="PLG_USER_PROFILE_FIELD_COUNTRY2_LABEL"/>JOPTION_REQUIRED JOPTION_OPTIONAL JDISABLED </ field >
1: When going to the user's profile page, the country name is displayed
1: The country ID is displayed on the user's profile page instead of the name.
PHP Built On Linux ecws 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64
Database Version 5.6.19-log
Database Collation utf8_general_ci
PHP Version 5.5.9-1ubuntu4.7
Web Server nginx/1.6.2
WebServer to PHP Interface fpm-fcgi
Joomla! Version Joomla! 3.3.6 Stable [ Ember ] 01-October-2014 02:00 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36
See attached screenshot.
Labels |
Removed:
?
|
Many thanks it worked.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-04-01 14:09:00 |
Labels |
Added:
?
|
Try