BuddyDev

Search

BuddyPress Custom Xprofile Fields (field type number_minmax)

Tagged: 

  • Participant
    Level: Initiated
    Posts: 19
    Quint A. Rahaman, Jr. on #46473

    Hello,

    The p.description element is supposed to be located between the legend and input elements. Could the plugin be updated to reflect what I believe is the standard?

    
    <div class="editfield field_35 field_rating-singles-est-numerical field_order_10 optional-field visibility-public field_type_number_minmax">
      <fieldset>
        <legend id="field_35-1">Rating - Singles (est. numerical) </legend>
        <input id="field_35" name="field_35" type="number" value="a:0:{}" min="1" max="12">
        <p class="description" id="field_35-3" style="margin-bottom: 0px !important; margin-top: 12px !important;">Self-estimated rating</p>
        <p class="field-visibility-settings-notoggle field-visibility-settings-header" id="field-visibility-settings-toggle-35">
          <span class="current-visibility-level">Public</span>
        </p>
      </fieldset>
    </div>
    

    Thank you,
    Quint

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #46483

    Hi Quint,
    Thank you for bringing it.

    The problem is there is no standard consistent way specified.

    Some of the field types in core have it as you have specified and some have it differently.

    1. After Input fields
    https://github.com/buddypress/buddypress/blob/master/src/bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php

    2. before input fields
    https://github.com/buddypress/buddypress/blob/master/src/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php

    There are many field types with this inconsistency, so we don’t have a standard here.

    I am willing to change as you have suggested but I am worried about its ipact on the existing installs.
    Do you have suggestions to deal with that.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 19
    Quint A. Rahaman, Jr. on #46498

    Hello Brajesh,

    Ugh. This should be an item for the core team to resolve. Because of this inconsistency, the visibility field is also underneath the input field which may lead to two pieces of data that the user has to process in the same spot. The visibility info is in the right spot and the info field should be directly under the legend since that’s what it is meant to explain and/or set the stage for the upcoming input.

    An ugly recommendation would be adding a setting to the Add/Edit xProfile field page which is set to default and provides the user with the option to reverse the default whatever that may be.

    The other ugly suggestion is to execute code to relocate the element after the page has been rendered. Unfortunately, this movement would be visible to the user.

    Or if there’s a hook for the field group pages before it renders, run the relocation code then? Do you know if there’s such a hook?

    https://www.dropbox.com/s/ce1ww4bcfnin7cc/Screen%20Shot%202022-09-12%20at%207.38.51%20PM.png?dl=0

    https://www.dropbox.com/s/l2rjdmxg68foe04/Screen%20Shot%202022-09-12%20at%207.54.59%20AM.png?dl=0

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #46510

    Hi Quint,
    Thank you for the suggestions.

    Please allow me to explore it for the custom fields plugin. I will let you know within 2 days.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved