Topic-icon Adding required field to Social Network Registration

Active Subscriptions:

None
We have a pretty customized splash login and registration flow, but have hit a small roadblock and could use some help. We have a required Text Field that is required to be filled in, and need it to show up on the simplified registration form. We don't want to use the Full EasySocial form, as it doesn't pull in the FB/Twitter profile pic and cover pic - so we are editing the default.php to suit our needs in JFBConnect.

The snag we hit is the following code from Line 71 of default.php:

How do I get (or call) an input box that has the name 'exampletext'? Can I inject it somewhere in this code (say...before the name/username fieldset stepthru)?
<div id="jfbc_loginregister_newuser" class="<?php echo $newUserSpan;?>">
            <form action="" method="post" id="adminForm" class="form-validate">
                <?php foreach ($this->form->getFieldsets() as $fieldset): ?> 
                                    <?php $fields = $this->form->getFieldset($fieldset->name); ?>
                    <?php if (count($fields))
                    {
                        ?>
                        <fieldset>
                            <?php if (isset($fieldset->label))
                            { // If the fieldset has a label set, display it as the legend.
                                ?>
                                <legend><?php echo JText::_($fieldset->label); ?></legend>
                            <?php } ?>
                            <dl>
                                <?php foreach ($fields as $field): // Iterate through the fields in the set and display them.?>
                                    <?php if ($field->hidden)
                                    { // If the field is hidden, just display the input.
                                        ?>
                                        <?php echo $field->input; ?>
                                    <?php
                                    }
                                    else
                                    {
                                        ?>
                                        <dt>
                                            <?php echo $field->label; ?>
                                            <?php if (!$field->required && (!$field->type == "spacer"))
                                            {
                                                ?>
                                                <span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL'); ?></span>
                                            <?php } ?>
                                        </dt>
                                        <dd><?php echo $field->input; ?></dd>
                                    <?php } ?>
                                <?php endforeach; ?>
                            </dl>
                        </fieldset>
                    <?php } ?>
                <?php endforeach; ?>
                <div class="profile-fields">
                    <?php
                    foreach ($profileFields as $profileForm)
                        echo $profileForm;
                    ?>
                </div>
The topic has been locked.
Support Specialist
You really shouldn't edit the default.php file to do what you're looking for. That would properly show the field, but without any extra logic to actually save that field, you wouldn't get the results you want.

The best way to show and save profile fields on the JFBConnect registration page is to create a Social Profile plugin. For other plugins, like K2, JomSocial, Kunena, K2 and others, we have code already to fetch and display additional fields using the getRegistrationForm function. Then, there is a createUser function you can implement to fetch and save that field however you want in the database.

I hope that helps give you some suggestions. The Social Profile plugins can look complex, but they are meant to be a nice way to hook into the registration flow to do exactly what you're looking for.. without modifying JFBConnect files directly.

Thanks,
Alex
The topic has been locked.