Skip to:
Content
Pages
Categories
Search
Top
Bottom

Using divs instead of tables in Profiles layout

  • Avatar of houfton
    Houfton
    Participant

    @houfton

    I have not been able to find anything about this. [Is there no search box for the forums or am I being stupid?]

    The profile-fields loop in bp-default uses a table layout. I have seen divs used in a premium plugin (buddydev’s cosmicbuddy). I think that a non-table layout would give the flexibility I need, particularly as member Profiles is probably going to be the most important component for the site. Is there any well-known way to do this before I have a go myself and perhaps try to reinvent the wheel. (OK it is a very tiny wheel!)

    I am just starting out with a clean install of BuddyPress 1.5.4 on WordPress 3.3.1 and am making a child theme of bp-default.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of Paul Gibbs
    Paul Gibbs
    Keymaster

    @djpaul

    You’ll just need to put the relevant templates into your child theme, and change the markup as you want.

    Avatar of houfton
    Houfton
    Participant

    @houfton

    Thank you. That seems very obvious now you say it!

    I have been trying to add ids to my divs using a sanitised version of the field name eg First Name becomes `

    `.

    I have tried using WordPress functions like `sanitize_title(bp_the_profile_field_name())` but this does not work. How should it be done?

    Avatar of houfton
    Houfton
    Participant

    @houfton

    In case anybody is interested (!) I found a solution using the bp_field_css_class function: `<div>`. This gives my divs a class name based on the field name eg: `

    `.

    The trouble I have now is that the profile loop seems to be ignoring the styles in my child theme’s style.css file – apart from the body tag styles which it applies. I can’t work that one out at the moment.

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    > I have seen divs used in a premium plugin (buddydev’s cosmicbuddy).

    Do bear in mind though that a ‘div’ is simply an non semantic aggregating element not intended to directly hold parsed character data so you do need a markup structure to hold your fields if not a table construct – which is pretty much a fair use for this data – then a list structure ‘ul’ or ‘dl’ can work.

    Avatar of houfton
    Houfton
    Participant

    @houfton

    I take your point, thank you. I should probably use a list rather than divs. The main thing is I want to be able to manipulate the layout using css.
    [deleted rest: just my stupid mistake!]

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.