0

I'm using the Members module and would like some users to enter just these fields to register: username, password, email address. But I'd like to collect that plus my custom member fields from other users who are using a different function of the site.

Is there a good way of doing this?

Right now I'm trying editing /themes/default/registration_form.html. I removed those useless "AIM" type fields, leaving me with username, password, email, custom fields loop. So I was thinking of wrapping a conditional around the custom fields that checks a URL segment, but passing an additional segment--e.g. members/register/add_custom_fields--is getting a 404 error. Maybe there's another way of passing some flag to tell the page whether to show the custom fields?

Using EE 2.7.3

Any tips are appreciated.

2
  • Has anyone tried Solspace User? Thoughts on it? I'm considering this, too, for my situation.
    – jphansen
    Mar 20, 2015 at 13:24
  • /themes/default is not a User package path, nor is it a path in EE. In any case, you should not edit the files in User's /themes/third_party/user folder: these are used for installing the Demo Templates in EE. You can install these templates form the CP, under the User module's "Demo Templates" tab. After installation, these will become regular EE template which you can edit.
    – Solspace
    Mar 23, 2015 at 3:24

4 Answers 4

2

Avoid messing with the ExpressionEngine templates. Try using FreeMember, it lets you place the registration code in your own templates and pick and choose the fields you want to retrieve from the user. Also, it helps that it's free and easy to use.

1

I've never used FreeMember but we're using Zoo Visitor on our site and have separate fields for different users. Zoo Visitor is not free but really well built, has great documentation and support.

0
1

I ended up using Solspace User to solve this, specifically the {exp:user:register} tag. I created one template with some fields, and another template with other fields, and it worked fine. It sounds like FreeMember was intended to do this, as well, but I couldn't get that to work.

1

In the case of your specific question, the problem is your /add_custom_fields part is technically part of the path query parameter.

What you could do is add it as part of a query string (so members/register/?extended=true) and then detect with

ee()->input->get('extended');

Make sure you check that the setting to allow get parameters is allowed.

Another method I would consider is rolling your own registration form as a template that you can embed, lets say site/.regForm for example, it just needs to post to the register_member action that you can get from your DB table exp_actions or with ee()->functions->fetch_action_id("Member","register_member");

in here, set up your custom fields in a conditional set to an embed variable like so

{if {embed:show_extended} == 'yes'}
    {!-- Show custom fields here --}
{/if}

Next, mak a template to hold the 'standard' sign up form, lets say site/register and embed your registration form. Or as you're editing the member templates you could edit the actual template to embed your custom form.

Lastly, create your 'extended' registration template, at site/full-register and again embed your form, but this time set show_extended to true.

Should all work fine.

Your Answer

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

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