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:
$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

DeWebmakers
 
c5studio replied on at Permalink Reply
c5studio
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.
maartenfb replied on at Permalink Reply
maartenfb
This call seems to return div tags.
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.
pixelfish replied on at Permalink Reply
pixelfish
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.
Glucose replied on at Permalink Reply
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:

<?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;


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.