XF 2.2 Add more (non-required) info during registration

Black Tiger

Well-known member
At this moment, when registration is clicked, only user name, password, email address and and website boxes are asked.
I don't know why website is there and some others are not.

Isn't it possible to have more filled in there by default for registration? Like for example location and date of birth?

Website is not required either, so it would be nice if we could directly add some others, but also not required. Can this be done? If yes, how?
 
Wouldn't this conflict with existing fields to complete profile?
For example there is already a location field. If I create a custom user field for location, wouldn't we get 2 location fields upon finishing profile?
 
Location and data of birth can already be set as required fields.
Correct.

Not really sure what it is you're asking to do.
Show them in the registration screen as UNrequired fields, like the website.

1615427467046.webp

As the arrow shows, I've got website there, but that field is not required. I would like to have location and date of birth the same way in this registration screen. So present, but not required.

Since there is a build in location field (which can be set to required) I wonder if I create a custom location field to be shown here, might cause 2 location fields in the profile. The build-in and the custom made.
 
So you want to have location and date of birth optional?

Untested but you will have to modify the register_macros template and replace the existing section of code related to dob and location with this:

HTML:
<xf:macro name="dob_row" arg-dobData="{{ [] }}">
    <xf:macro template="helper_user_dob_edit" name="dob_edit"
            arg-dobData="{$dobData}" />
</xf:macro>

<xf:macro name="location_row"
    arg-fieldName="location"
    arg-value="">
    <xf:textboxrow name="{$fieldName}" value="{$value}"
            label="{{ phrase('location') }}" />
</xf:macro>
 
Thank you.
But if not really necessary I rather would not change default things like macro's and templates.

So I will choose to set location to required and leave out the birthday part, they can fill it in if they want via their profile.
 
Back
Top Bottom