Helping you Build Your Own Social Network!

Faster, better and easier!

Edit signup form

(4 posts) (2 voices)
  • Started 1 year ago by ultimateuser
  • Latest reply from Brajesh Singh

Tags:

No tags yet.


  1. I have a multiselectbox where Id like to add OPTGROUP labels to the options availabe, so the dropdown list of

    apples
    bananas
    pears

    I would like to give a heading ‘Fruit’ (which on its own is not selectable). Ive been browsing the web for the last hours to find where I can edit this, as buddypress does not give the option to group items.

    Can anyone give me a head start on which file(s) needs editing?

    Posted 1 year ago #
  2. Hi, Look for "bp_get_the_profile_field_options" you will see the option how it is generated and add the appropriate code using above filter.

    Posted 1 year ago #
  3. @sbrajesh Thank you for your reply.

    I suppose I would need to edit 'bp-xprofile-templatetags.php' cos this is where I found "bp_get_the_profile_field_options"

    I am a complete Buddypress / PHP beginner. Could you possibly give me an example code and where I would need to insert this??

    Ive been trying to get this to work for so long now, your help is much appreciated!!!!

    Posted 1 year ago #
  4. Hi, well, Yn that case I will recommend something easier. You can change it in the registration/register.php(of the theme ) and members/single/profile/edit.php.

    You will see the code as below

    <?php if ( 'selectbox' == bp_get_the_profile_field_type() ) : ?>

    below that change this

    <select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>">
     <?php bp_the_profile_field_options() ?>
    
       </select>

    to

    <select name="<?php bp_the_profile_field_input_name() ?>" id="<?php bp_the_profile_field_input_name() ?>">
      <?php if( bp_get_the_profile_field_name()=="Test Box"):
    //change the name to the field name you have addedd
    ?>
     <optgroup label="Test Box">
     <?php endif;?>
    
    <?php bp_the_profile_field_options() ?>
      <?php if( bp_get_the_profile_field_name()=="Test Box"):
    //change the name to the field name you have addedd
    ?>
     </optgroup>
     <?php endif;?>
       </select>

    That will add the optgroup for specific fields but not all the select box

    Posted 1 year ago #

Reply

You must log in to post.