Replies
Hi Brajesh,
sorry to bother you with this.. I’m not good in php but I could figure out how to solve the problem with some JS, I found here:
https://wordpress.org/support/topic/field-description-below-label-script-not-working/jQuery('p.description').each(function() { // Clone description // Looking for parent // Looking for first label legend var desc = jQuery(this).clone(), parent = jQuery(this).parent(), label = parent.find('legend:first'); // If there is a label. if (label.length) { // Putting the description after the label. label.after(desc); // Removing the original description. jQuery(this).remove(); } });
Nevertheless I would prefer an add filter solution in your plugin. Because I don’t know the negative aspects (resources) of this JS. On the other hand I understand your time preferences for this free plugin. Which I appreciate very much. Thank you.
Hi Brajesh, interesting.
In my comment #45605 I posted a screenshot of a field type “Birthday selector” (https://ibb.co/Br983Lh), which is provided by your plugin. Here, the description is put in second place, after the field name.I copied the beginning html structure here:
<div class="editfield field_50 field_alter field_order_1 required-field visibility-loggedin alt field_type_birthdate"> <fieldset> <legend>Geburtsdatum</legend> <p class="description" tabindex="0">Lorem ipsum</p> <div class="input-options datebox-selects"> <label for="field_50_day" class="xprofile-field-label">Day</label> <select id="field_50_day" name="field_50_day" aria-required="true"> <option value="">----</option> <option value="1" selected="selected">1</option> ...
The other field types act like you describe, description in 3rd place.
So, is there a chance that you update the plugin so admins can choose where the description is placed a) before or b) after the custom input field?
Maybe in the form of an admin display option (when adding/editing) the field type. Or with an “add_filter” method in functions.php.
I would highly appreciate it, because from a usability point of view it makes more sense to read the instruction first (if a description is necessary). The major social networks behave the same.Thanks!
Ok, thanks for looking into it.
Yes, I’m using Buddyboss, but the thing with description placement works fine for some fields, e.g. “Birthdate selector”: https://ibb.co/Br983Lh
But not for other fields as reported (Image, File, Location, etc.). I did not tested all the other field types.
RegardsOk, thanks a lot!
My last point is a minor html typo in the following file, Line 78:
https://github.com/buddydev/bp-xprofile-custom-field-types/blob/c9b342a951124bf8d4f02dca79a119a7d66c7615/src/field-types/class-field-type-tags.php#L78“<?php _e( ‘Allow users to add new tags( If you tick this option, please make sure to enable select2strong> from right sidebar).’, ‘bp-xprofile-custom-field-types’ ); ?>”
The enable select2strong> is duplicated. But it’s just instructional text.
The image link to my previous comment is here:
https://ibb.co/JHgPC3SThere is one more thing with the styling, mentioned in my initial post:
“2. Display issue: “Edit Profile” mode -> entering tags
2.1 When entering tags, the first 3 letters typed by the user are hidden by the magnifier icon. Can this be changed?
2.2 The input form where tags are entered is not responsive. If the window is rezeised, the form width stays fixed.”I’m using Buddyboss theme and wehen enabling Select2 (Enable select2 javascript code) for a tag field or multi select field, I do have some display issues. Maybe this is a theme specific CSS issue. It looks like this when typing the first letters, e.g. “Engli” then the “En” is hidden by the magnifying glass icon.