Use placeholders instead of labels

BP Profile Search › Use placeholders instead of labels

  • Author
    Post
  • #11238 Reply
    Adele
    Guest

    Hi Andrea

    How can I customise the form template to use placeholder text instead of labels?

    #11239 Reply
    andrea
    Plugin Author

    Hi Adele,

    If you wish to customize the textbox search fields, locate the ‘textbox’ case in the template, and add the placeholder attribute:

    	case 'textbox':
    ?>
    			<input placeholder=<?php echo $f->label; ?> type="search" id="<?php echo $id; ?>" name="<?php echo $name; ?>" value="<?php echo $value; ?>"><br>

    Then you will have to remove the label for the textbox fields. Locate the lines that display the field label, and enclose them in an if statement:

    		<?php if ($display != 'textbox') { ?>
    			<label for="<?php echo $id; ?>" class="bps-label">
    				<strong><?php echo $f->label; ?></strong><span> <?php echo $f->mode; ?></span>
    			</label><br>
    		<?php } ?>

    To read more about modifying the default form template, please see:

    https://dontdream.it/bp-profile-search/form-templates/

    #11445 Reply
    Lolo
    Guest

    Hi, I’m trying to do the same thing, but I don’t quite understand how to do it.

    I’ve managed to put a placeholder inside a selection field, but I can’t manage to put a placeholder inside a any profile field, because I have not field ID.

    How can I made it?

    #11446 Reply
    andrea
    Plugin Author

    Hi Lolo,

    I’m not sure I understand your question correctly. Which field ID do you need?

Reply to: Use placeholders instead of labels
My Information