Show User Attribute Sets on Registration Forms
Permalink
Hi,
I have a lengthy registration form that needs to be grouped via their User Attribute Sets, is there a way to do this via the register.php file?
I have been doing a little research on php as its a language I am now having to understand a little; as I'm predominantly a front-end developer and notice that I could find the $variable and possibly "print" it? but i've tried to include it into the register.php existing code and it breaks.
could anyone suggest a way of doing this?
thanks in advance.
Best wishes,
Ben.
I have a lengthy registration form that needs to be grouped via their User Attribute Sets, is there a way to do this via the register.php file?
I have been doing a little research on php as its a language I am now having to understand a little; as I'm predominantly a front-end developer and notice that I could find the $variable and possibly "print" it? but i've tried to include it into the register.php existing code and it breaks.
could anyone suggest a way of doing this?
thanks in advance.
Best wishes,
Ben.
Im pretty sure Pro Forms does this. Its very flexible.
<fieldset>
<legend><?php echo t('Personal Details')?></legend>
<?php
$af = Loader::helper('form/attribute');
foreach($attribs as $ak) { ?>
<?php echo $set?>
<?php echo $af->display($ak, $ak->isAttributeKeyRequiredOnRegister()); ?>
<?php }?>
</fieldset>
I have found the fieldset within the register.php file, looking also at the group_sets.php file, I notice the necessary details to integrate into the register.php file.
What can I do to this section of code to ensure that the attributes are displayed and also the group_set variables which at present I believe is marked down as $gs?
Any help would be massively appreciated.
<legend><?php echo t('Personal Details')?></legend>
<?php
$af = Loader::helper('form/attribute');
foreach($attribs as $ak) { ?>
<?php echo $set?>
<?php echo $af->display($ak, $ak->isAttributeKeyRequiredOnRegister()); ?>
<?php }?>
</fieldset>
I have found the fieldset within the register.php file, looking also at the group_sets.php file, I notice the necessary details to integrate into the register.php file.
What can I do to this section of code to ensure that the attributes are displayed and also the group_set variables which at present I believe is marked down as $gs?
Any help would be massively appreciated.
Hi ALL,
would really appreciate any help on this. Will be working all day today to ensure this is fixed.
Thanks.
Ben.
would really appreciate any help on this. Will be working all day today to ensure this is fixed.
Thanks.
Ben.
apologies, got to keep this live until I find a solution. Really stuck.
$category = AttributeKeyCategory::getByHandle('user'); if (is_object($category) && $category->allowAttributeSets()) { $sets = $category->getAttributeSets(); foreach($sets as $as) { ?> <h3><? echo $as->getAttributeSetDisplayName()?></h3> <?php $attribs = $as->getAttributeKeys(); if (count($attribs) > 0) { foreach($attribs as $ak) { $af = Loader::helper('form/attribute'); echo $af->display($ak, $ak->isAttributeKeyRequiredOnRegister()); } } }
Viewing 15 lines of 16 lines. View entire code block.