Edit profile page to a custom form
Permalink
Hi,
I'm trying to make a new edit profile page.
I put all the necessary fields in concrete. But Concrete just makes a long list of all the formfield that I added. I want some designing in the page, maybe divide it over 2 pages...
So i made a single page with the formfields in the order I want, but how do I get the values from concrete for these formfields?
In the edit profile page of Concrete ther is the following code:
The function $af->display() shows the complete form...and i don't think I want that?!
Can anybody help me?
Regards,
Corretje
I'm trying to make a new edit profile page.
I put all the necessary fields in concrete. But Concrete just makes a long list of all the formfield that I added. I want some designing in the page, maybe divide it over 2 pages...
So i made a single page with the formfields in the order I want, but how do I get the values from concrete for these formfields?
In the edit profile page of Concrete ther is the following code:
$attribs = UserAttributeKey::getEditableInProfileList(); if(is_array($attribs) && count($attribs)){ $af = Loader::helper('form/attribute'); $af->setAttributeObject($ui); foreach($attribs as $ak) { print '<div class="ccm-profile-attribute">'; print $af->display($ak, $ak->isAttributeKeyRequiredOnProfile()); print '</div>'; } }
The function $af->display() shows the complete form...and i don't think I want that?!
Can anybody help me?
Regards,
Corretje
That only shows the attributes that are set in the dashboard, under 'Users and Groups' and then 'User Attributes.' If you add more attributes they should show up there, and if you remove them they wont show up anymore.
This call seems to return div tags.
I also just want the plain string in order to do my own style.
Is there a code snippet example that returns String only?
Thanks.
print $af->display($ak, $ak->isAttributeKeyRequiredOnProfile());
I also just want the plain string in order to do my own style.
Is there a code snippet example that returns String only?
Thanks.
Hi,
I am also currently playing with this. It would be great to have more flexibility with these attributes. The billing and shipping address call the same form, is there any way to have two separate forms so i can style them separately?
Also if i need to move the 'email address' attribute between the name and address attributes, currently i do not have control to do that as the profile/register page just calls all User Attributes.
I am also currently playing with this. It would be great to have more flexibility with these attributes. The billing and shipping address call the same form, is there any way to have two separate forms so i can style them separately?
Also if i need to move the 'email address' attribute between the name and address attributes, currently i do not have control to do that as the profile/register page just calls all User Attributes.
My method for creating a custom registration form was to first override the registration single page and set out a basic layout there. Secondly I overrode the form/attribute helper:
The extended public function field instead of creating a label AND field wrapped in bootstrap classes (which I try to avoid), spits only the field out.
Overriding is done by copying the file you want to over ride from the "ROOT/concrete/path-to-file/file.php" to "ROOT/path-to-file/file.php".
For example "public_html/concrete/single_pages/register.php" to "/single_pages/register.php".
I recommend looking into it further because if you truly want to customise stuff you'll need to create your own function and layouts which is done by extending what already exists.
<?php defined('C5_EXECUTE') or die("Access Denied."); class FormAttributeHelper extends Concrete5_Helper_Form_Attribute { public function field($key, $template = 'composer') { if (is_object($key)) { $obj = $key; } else { $oclass = get_class($this->obj); switch($oclass) { case 'UserInfo': $class = 'UserAttributeKey'; break; default: $class = $oclass . 'AttributeKey'; break;
Viewing 15 lines of 27 lines. View entire code block.
The extended public function field instead of creating a label AND field wrapped in bootstrap classes (which I try to avoid), spits only the field out.
Overriding is done by copying the file you want to over ride from the "ROOT/concrete/path-to-file/file.php" to "ROOT/path-to-file/file.php".
For example "public_html/concrete/single_pages/register.php" to "/single_pages/register.php".
I recommend looking into it further because if you truly want to customise stuff you'll need to create your own function and layouts which is done by extending what already exists.