Skip to:
Content
Pages
Categories
Search
Top
Bottom

Profile types

  • Avatar of James
    James
    Participant

    @janismo

    hnla said 11 hours, 56 minutes ago:

    To get you started create three new profile fields for users to complete, probably radio button choices, the users will select one of these at signup? make the selection obligatory.

    Now in the members profile loop you will use a simple check to determine which field has been returned or selected by the user and display whatever particular elements you want for that selection.

    The code used here is not the type you want, in a profile loop it’s easier as you can run checks using something like:
    if(bp_get_member_profile_data( ‘field=account type’ ) == ’special’) :
    ‘ Do stuff based on the type above’;

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of James
    James
    Participant

    @janismo

    ok, as I understand, the easiest way for me to get it done, is to place radio buttons in the base group and create x profile groups, each of groups will be called after “if(bp_get_member_profile_data( ‘field=account type’ ) == ’name’) :
    ” for each particular profile type from radio buttons.
    It will make only radio buttons to appear on the signup, but entering code into public and edit profile sections will force user to see only profile group, corresponding to his radio button?

    probably only I understood what I wrote :)
    should I use (bp_the_profile_group() == “group number”) function?

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Adding the required selection options means that each user has to select a given type (a default option should also be considered?)

    This selection will be displayed on the users profile, but what you now have is a means of checking against something specific. The code above would or should allow you to run specific code only if that condition is met so you could run that for each ‘type’ and end it with an ‘else’ clause for perhaps a default body of code to run if the other conditions are not met.

    Where exactly you might place this code is somewhat for you to decide as at this stage we can’t know exactly what portions of a page or profile elements you wish to add unique styling to.

    But have a go at setting it up in a basic fashion and checking for yourself that the theory works i.e set up the new profile radios then perhaps in the profile loop do a simple check to see if you can run the conditional outlined above and simply output a line of text for testing purposes.

    Avatar of James
    James
    Participant

    @janismo

    thanks for reply hnla.
    what I’m trying to put into profile-loop.php is:

    `

    (repeat code above for other 3 selections)

    `

    idea is that I want to place radio button with four selections (Professional, .., …, … .) on the signup page (in group Base). when one of them is selected, profile group with same name appears on public and edit profile pages. If no one is selected, what is impossible, because field is “required”, then base group appears.

    at the moment code does not work, any idea of corrections or exact line where to put it, would be highly appreciated!

    thanks.

    Avatar of James
    James
    Participant

    @janismo

    sorry for the update, but I think base group should be added to every selection too, probably, it will go to:

    Avatar of noizeburger
    noizeburger
    Participant

    @noizeburger

    Does Janis’ solution work? In which place should I place this code?
    Thanks

    Avatar of James
    James
    Participant

    @janismo

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

The topic ‘Profile types’ is closed to new replies.