码迷,mamicode.com
首页 > 其他好文 > 详细

Joomla 3.x. How to edit registration page

时间:2016-08-14 19:12:21      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:

Adding registration form fields

In order to add new fields to the registration form, database and files update is required. The following database changes are required:

  1. Access the database assigned to your site using PhpMyAdmin tool on your hosting Cpanel.

  2. Browse XXX_users table. XXX is your the database table prefix:

    技术分享

  3. Click on the Structure button.

  4. Choose elements between which you would like to paste a new field.

  5. Specify columns number under Add section. Add chose database ID after which new item will be shown.

  6. Click on Go button:

    技术分享

  7. Specify Name, Type and Length settings on the next screen.

  8. Save changes:

    技术分享

In order to make a new field appear on your site, modify the following files:

  1. Edit user.php file from the libraries/joomla/user folder. Find code for the field after which your new section should come:

    public $name = null;

    Add code for your new field just under the code above:

    public $field_lable_here= null;

    Where field_lable_here is your new field title.

  2. Modify users.xml file from administrator/components/com_users/models/forms directory.

    Find code for the field after which your new field will be shown:

    1
    2
    3
    4
    5
    6
    <field name="name" type="text"
            description="COM_USERS_USER_FIELD_NAME_DESC"
            label="COM_USERS_USER_FIELD_NAME_LABEL"
            required="true"
            size="30"
    />

    Add code for your field just under the code below:

    1
    2
    3
    4
    5
    6
    <field name="field_lable_here" type="text"
            description="Your description"
            label="field_lable_here"
            required="true"
            size="30"
    />

    Replace field_lable_here with your new field label. Change Your description text to your description.

  3. Edit registration.xml file from the components/com_users/models/forms folder on your server. Add code for your field under the code used for the field after which you would like to show your new field:

    1
    2
    3
    4
    5
    6
    <field name="field_lable_here" type="text"
            description="Your description"
            label="field_lable_here"
            required="true"
            size="30"
    />

Upload the modified files on your server. Refresh your site to see the change.

 

Joomla 3.x. How to edit registration page

标签:

原文地址:http://www.cnblogs.com/hjxcode/p/5770677.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!