0

I have written an override for the core Joomla User Registration and put it into:

/templates/protostar/html/com_users/registration/forms/registration.xml

For external API reasons I have had to split the Name into two fields - First Name and Last Name. I have edited the 'Name' field to show as 'First Name' and created a new field for 'Last Name' field as follows:

    <field
        name="name"
        type="text"
        description="Please enter your first name"
        filter="string"
        label="First Name"
        required="true"
        size="30"
    />

    <field
        name="LastName"
        type="text"
        description="Please enter your last name"
        filter="string"
        label="Last Name"
        required="true"
        size="30"
    />

This works great in the front end, however when the user is created it is only showing the First Name in the Name field, how can I get the Last Name to be pushed through to the Name data field aswell?

1 Answer 1

1

I might be off with this, but your first name field definition is still "name", so its only capturing the "first" part and storing it. Presumably, it's saving the "second" part as the last name.

I can't walk you through the specifics of changing it without knowing it better, but you'll have to walk with caution because THIS code appears to be changing how the core files uses the "name" field. Your plugin is going to have to recognize the first/last portion and do the manipulation to give Joomla the full name which it depends on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.