BuddyDev

Search

[Resolved] add extra css on a profile field

  • Participant
    Level: Initiated
    Posts: 7
    Bouke Star on #30469

    Hi

    Im using the really nice plugin BuddyPress Xprofile Custom Field Types for my BuddyBoss theme. I’m wondering how I can add extra css on a profile field inside this plugin.

    Thanks for your help.
    Regards Bouke

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #30471

    Hello Bouke,

    Than you for posting. If you are looking for adding extra CSS within plugin files is not a good idea because if you update the plugin all your changes will be removed. So, If you want to override the CSS you can put CSS under child theme or addition CSS section in customizer.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 7
    Bouke Star on #30473

    Hello Ravi,

    Thanks for your feedback. Indeed, it is not a good idea to tweak the plugin for an extra css rule with new coming future updates. However I thought that the <td class=”data”> (I want each word in the field give an independent border.) comes from the custom field types plugin and not from the theme. It seems that this can be fixed inside buddypress but not really sure how.

    Thanks
    Bouke

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

    Hi Bouke,

    BuddyBoss theme has full control over the profile data listing style.

    The markup comes from the theme and not from the plugin. We do not add any markup(except for image field, we do add img tag).

    Do you want to add a border around “data” cell or do you want to do it for some specific field type values where field type is offered by us. In the later case, I can look into it and assist you.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    Bouke Star on #30525

    Hi Brajesh,

    Thanks for your feedback. Indeed I want a border round a specific data cell. So for Example: My hobby’s are: Skating, Tennis, Playing games. That is the specific data cell.

    In the buddypress forum I post this qeustion also with this info:

    I’m looking for a solution to place an extra css rule on the: <td class=”data”><?php bp_the_profile_field_value(); ?></td> in the profile-loop.php. So I can give every filled in answer a border column in the profile. I’ve tried it with: <td class=”data”><span class=”fieldinfo”><?php bp_the_profile_field_value(); ?></span></td>. But this give to whole field section a border and not an individual filled in answer.

    Regards Bouke

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

    Hi Bouke,
    Thank you for sharing the details.

    Which field type are you using for that specific field?

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    Bouke Star on #30542

    Hi Brajesh,

    I’m using the multi select type and have enabled select2 javascript code.

    Regards,
    Bouke

  • Participant
    Level: Initiated
    Posts: 7
    Bouke Star on #30599

    Hi Brajesh,

    Any idea or this is possible?

    Thanks
    Regards Bouke

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

    Hi Bouke,

    Please put the code from the link in your bp-custom.php
    https://gist.github.com/sbrajesh/086c2741380a24149771cab1b32b0404

    It will add span for each multi select entry and you can style them as you want.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    Bouke Star on #30607

    Hi Brajesh,

    Nice, it’s almost fixed. I’ve placed your code in the theme functions because Buddyboss don’t use the bp-custom.php. All the words get a border for multi select fields, except the first word from the section. This word don’t get a border.

    Regards,
    Bouke

The topic ‘ [Resolved] add extra css on a profile field’ is closed to new replies.

This topic is: resolved