Move up the user attribute fields

Permalink Browser Info Environment
How can I move up the user attribute fields on the signup form, so that it shows up right before the email address field?

Type: Discussion
Status: New
geek2009
View Replies: View Best Answer
Tony replied on at Permalink Best Answer Reply
Tony
there isn't currently a way to do this directly through the block's edit interface, but you can do it by editing the mailing list blocks view file. If you're familiar with php, open up /packages/tony_mailing_list/blocks/tony_mailing_list/view.php, and move this section:

<? if( !$u->uID ){ ?>
<div class="mailing-list-email-wrap">
<?=t('Email:') ?>
<? if($controller->attrsRequired || count($userAttrIds)){ ?>
<span class="required"><?=t('*')?></span><? } ?>
<input name="email" type="text" value="<?= htmlentities( $_REQUEST['email'], ENT_QUOTES, 'UTF-8') ?>" />
</div>
<? }else{
$ui = UserInfo::getById($u->uID);
} ?>


..down so it's right above the:
<input name="Submit" type="submit" value="<?=t('Sign-up &raquo;') ?>" />
geek2009 replied on at Permalink Reply
geek2009
I tried that, but nothing changed.
geek2009 replied on at Permalink Reply
geek2009
Sorry, I had to clear my cache. It works just fine now. I made a mistake deleting the attribute section of that file on accident. Is their anyway that I can get this back? Maybe you could post or pm me just that part of the code. Thanks!
Tony replied on at Permalink Reply
Tony
you could just download it again, but here it is:
<? if(count($userAttrIds)){ ?>
<div class="mailing-list-user-attrs">
<? foreach($userAttrIds as $userAttrId){
$userAttr = UserAttributeKey::getByID(intval($userAttrId));
if(!is_object($userAttr)) continue;
if(is_object($ui)) $vo=$ui->getAttributeValueObject($userAttr);
else $vo=false;
$hasAttrs=1;
?>
<div class="mailing-list-user-attr">
<label><?=$userAttr->getAttributeKeyName() ?>
<?= ($controller->attrsRequired) ? '<span class="required">'.t('*').'</span>' : '' ?>
</label>

<?
//$vo = $uo->getAttributeValueObject($userAttr);
echo $userAttr->render('form', $vo, true);
?>
</div>
<? } ?>
</div>
<? } ?>
geek2009 replied on at Permalink Reply 1 Attachment
geek2009
One last question, how do I get the text "name" to show up to the left of the box to match the email box above it?
geek2009 replied on at Permalink Reply
geek2009
I figured this out. All I had to do was delete the following line out of the mailing_list.css file.
.MailingListSubscribe .mailing-list-user-attr label { display:block; }

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.