Customizing the Register page
Permalink
Greetings,
I'm going to attempt to modify the register page, but I'm curious about the form fieldnames that I see in the source.
Some of the fieldnames are "logical", such as:
<input id="uName" name="uName" etc... />
<input id="uEmail" name="uEmail" etc... />
Several others, however, are more confusing:
<input id="akID[31][value]" type="text" name="akID[31][value]" .../>
These are clearly dynamic fields (attributes), but I'm curious as to if this is correct. Should the actual fieldnames as defined in the attributes be showing, rather than: akID[x][value]?
My problem is this: I have a couple of add-ons, one of which is requesting a "name" (full name) on the register form. The other one is requesting separate last name and first name fields. The register form ends up with three name fields.
I want to edit this so that I'm only asking for the first and last names. I can concatenate these fields myself into the "full name" field, so the user does not have to enter their name twice.
But, it's hard to see which fields to work with when they're showing in the "view source" code as these adID fields.
Any suggestions?
Thanks.
I'm quite new to C5, but slowly getting the hang of it. If I'm going about this the wrong way, please enlighten me! :)
Bill
I'm going to attempt to modify the register page, but I'm curious about the form fieldnames that I see in the source.
Some of the fieldnames are "logical", such as:
<input id="uName" name="uName" etc... />
<input id="uEmail" name="uEmail" etc... />
Several others, however, are more confusing:
<input id="akID[31][value]" type="text" name="akID[31][value]" .../>
These are clearly dynamic fields (attributes), but I'm curious as to if this is correct. Should the actual fieldnames as defined in the attributes be showing, rather than: akID[x][value]?
My problem is this: I have a couple of add-ons, one of which is requesting a "name" (full name) on the register form. The other one is requesting separate last name and first name fields. The register form ends up with three name fields.
I want to edit this so that I'm only asking for the first and last names. I can concatenate these fields myself into the "full name" field, so the user does not have to enter their name twice.
But, it's hard to see which fields to work with when they're showing in the "view source" code as these adID fields.
Any suggestions?
Thanks.
I'm quite new to C5, but slowly getting the hang of it. If I'm going about this the wrong way, please enlighten me! :)
Bill
Thanks.
That helped a bit. It pointed me in the general direction I needed, in any case.
I was able to modify the code to:
(a) Not display the "full name" field on the registration form
(b) copy the first_name and last_name values into this full name field on registration.
(I know I could have simply turned off the "show in registration form" property of the attribute, but I wanted it to remain there, so that I could populate it from the other fields.)
Thanks for the quick response.
Bill
That helped a bit. It pointed me in the general direction I needed, in any case.
I was able to modify the code to:
(a) Not display the "full name" field on the registration form
(b) copy the first_name and last_name values into this full name field on registration.
(I know I could have simply turned off the "show in registration form" property of the attribute, but I wanted it to remain there, so that I could populate it from the other fields.)
Thanks for the quick response.
Bill
Can you share how you managed to combine the first and last name attributes to make the full name?
I've been trying to figure this out for too long!
I've been trying to figure this out for too long!
Greetings,
It took me a little while to figure out what I did with this, since it's been a while.
In the single_pages\register.php file, I made the following change to stop the system from prompting for the "subscriber_name" (full name), since it was already prompting for the first and last names individually:
(I added the condition above to simply not include the subscriber_name prompt)
In the controllers\register.php file, I made this change, to populate the subscriber_name field with the contents of the first and last name values:
The above foreach loop is found starting on line 117 in my controllers\register.php file.
I hope this helps you.
I've done very little with customizing C5, so there may be more elegant ways of doing this. I don't recall how I figured out which akIDs I needed. Could have been from "view source" on the register page, or I might have made a debug loop of code to dump all the values until I found the ones I needed.
It took me a little while to figure out what I did with this, since it's been a while.
In the single_pages\register.php file, I made the following change to stop the system from prompting for the "subscriber_name" (full name), since it was already prompting for the first and last names individually:
(I added the condition above to simply not include the subscriber_name prompt)
In the controllers\register.php file, I made this change, to populate the subscriber_name field with the contents of the first and last name values:
The above foreach loop is found starting on line 117 in my controllers\register.php file.
I hope this helps you.
I've done very little with customizing C5, so there may be more elegant ways of doing this. I don't recall how I figured out which akIDs I needed. Could have been from "view source" on the register page, or I might have made a debug loop of code to dump all the values until I found the ones I needed.
http://www.concrete5.org/documentation/how-tos/designers/creating-a...
Should output the form element for you.