You can add your own custom attributes (for example, name and address) to a user.
First you have to turn on Public Registration (it’s off by default)
Dashboard > System and Settings > Login and Registration > Public Registration
Under “Allow Visitors to Signup as Members” select “On – email validation” (You can choose the other options but this one has been recommend to me, so this is the one I chose).
Dashboard > Members > Attributes
Select or create new attributes and then check “Show on Registration Form“.
Checking this box tells Concrete5 to put this on the registration form. Specifically, in the file:
- under the methond named do_register():
$aks = UserAttributeKey::getRegistrationList();
getRegistrationList() gets all of the attributes which have “Show on Registration Form” checked. If the user filled out that field, then it gets added as a User Attribute.
There are a few posts on how to make a custom registration page so I won’t go into detail about that.
Under the controllers folder (your controllers folder, not the concrete/controllers folder) create a file called sample.php.This is your controller file.
Under the single_pages folder create a file called sample.php. This is your view file.
Then go to the Dashboard > Pages and Themes > Single Pages and create a file called sample.
Single pages usually default to view.php, and any content you place in say, single_pages/sample.php will show up where you place:
This bit of code goes into your view.php file (in your theme folder) where you want to place the content from your view (in your single_pages folder…in this case, the file called sample.php which is in the single_pages folder).
Alternately, you can create a template with the same name as the controller and view (in this case, sample.php) drop that file into your theme folder, and that will work too (instead of using view.php). This gives you the chance to customize the look and feel a bit more.
Go to Dashboard > Sitemap and find your page (sample).
Go to view the page and add a form block.
Add some questions to the block and then click “Add”. Once you are done, view the HTML source of the form.
Your inputs will look like:
<input type="text" name="QuestionNumber" value="">
Where I wrote “QuestionNumber” it’s usually a number like “Question24″ or “Question8″. Write these down for the inputs you want to pre-fill.
Remember, “special thing” gets passed to the view from the controller by:
Easier than trying to override the form block.