Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Custom registration form - adding fields to main user table in CMS Desk -> Admin View modes: 
User avatar
Member
Member
phansen-fph - 5/22/2012 5:35:23 PM
   
Custom registration form - adding fields to main user table in CMS Desk -> Admin
I've created a custom registration form using the Alternative Forms and that is all working successfully. I have three additional fields in the form - Country selector, company name, and a terms & conditions check box. The form is working well but I can't work out how to view these extra fields in the main user table under the CMS Desk --> Admin, or in the notification emails.

I recieve the auto email saying there is a new user waiting for approval, but it only contains the standard fields of first name, last name, e-mail and username. I tried adding additional data macros but the standard 4 are the only ones listed as available to use.

Once a new user has tried to register, I go to CMS Desk -> Administration -> Users -> Waiting for approval, and i see the user, but only Username, Fullname, Email, Nickname, Created, Enabled fields (columns) are shown. I can't see how to change the view of this table to add different field columns? I need to be able to see that the user has agreed (ticked yes) to the terms and conditions field from the reg form in order to approve.

Any help much appreciated!

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 5/22/2012 10:35:42 PM
   
RE:Custom registration form - adding fields to main user table in CMS Desk -> Admin
Hello,

Have you added the new fields to the User or User setting system table? If so, you should see the 'Custom fields' tab in CMSDesk or Site manager -> Administration -> Users.

You can also add the logic directly to the field with Terms and condition - you can use the Validation section and set up how it needs to look like before the form is submitted.

Regarding e-mails: You can use a custom macro for this and get values by API (the fields must be added to the User or User setting system table).

Regarding changes of administration interface: You would need to re-write the pages which are used in the administration interface (How to find the location of the code for a page used in the user interface).


Best regards,
Helena Grulichova

User avatar
Member
Member
phansen-fph - 5/22/2012 10:54:06 PM
   
RE:Custom registration form - adding fields to main user table in CMS Desk -> Admin
Thanks for your reply.

To answer your questions - yes, the new fields were added to the User system table and yes, i do see them under the Custom fields tab. The Terms and Conditions field does have logic applied and the registration can not be submitted unless the check box is applied.

My issue is that I can not view the additional fields before approving the user registration. Only after the user has been registered can you see the Custom Fields tab with the additional info. I want to be able to see the custom fields on the main User table as additional columns. Is this what you are referring to in your last comment?

I tried adding a custom macro to the email, for example "Terms and Conditions: {%termsandconditions%}" but all that returned on the email was the text "Terms and Conditions:" without the field value. Do i need to specify the source of the data also in the macro?

Regards,
Paul

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 5/24/2012 6:20:43 AM
   
RE:Custom registration form - adding fields to main user table in CMS Desk -> Admin
Hello Paul,


You can see the user in the main list (Site manager -> Administration -> Users) even if he/she is not approved. So you can check the values there. If you need to customize the grid on the 'Waiting for approval' tab, you need to re-write the code of this page. Then the last paragraph can be helpful - how to find out what page contains the needful code.

{%termsandconditions%} won't work. It works only for the original User properties. You can only get them by API - user.GetValue(columnName). That is why you need to create a custom macro for this. (Similarly, this expression won't work: user.customField, you need to use the GetValue (or SetValue) methods.


Best regards,
Helena Grulichova