Keyword

Only use specific fields in user profile

More
10 years 2 weeks ago #131993 by Wendy
I'm relatively new to K2. I am trying to create a setup where people registering and logging in from a certain page will be able to enter/edit their user profile. I want the user profile to have *only* specific fields that I define. This includes information like education, country, details about their practice, certain professional numbers, etc, as well as name and email.

These users will be taking online courses we offer, although they will be available to anyone (registered or not). I want to offer users the option to register and login so that the course form can grab their user info from the profile, for our records, and that way they don't have to enter it again and again for every course they take.

I thought K2 might help me do this but so far I can't get it to work. I have created a User Field Group and have added a bunch of User Fields to that group. I have also created a User Group and assigned one test account to it.

The first problem is that I don't know how to link the User Field Group and its Fields to that User Group or its users. When I login as the test user account and click "My Account", I only see what seems to be the default Joomla (and K2?) user profile fields (address, avatar, description, etc). Most of these fields are not what I want them to use. I would rather display *only* the fields relevant to those users in their profiles.

The second problem is that none of the K2 defined fields are showing up at all in the "My Account" profile edit page. I have no idea how to link them to the profile edit and there doesn't seem to be any documentation about this.

I tried installing the User Extended Fields K2 extension, hoping that this would give me a way to do this, but this only seems to add more fields that I don't want to include (social media). There doesn't seem to be *any* documentation for this extension, and although it's apparently included in the K2 demo site, there doesn't seem to be a demo user account I can log into to see how that works, nor a way to register my own.

So: will K2 allow me to limit the fields in a user's profile to only the fields I want to use, and if so, how? What little K2 documentation there is suggests I can do that, but I don't see anything that says how to do this.

Will the Extended User Fields extension help me do this, or will it just get in the way? I'll uninstall it if it's not helpful.

Many thanks in advance for the help.
Wendy

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 2 weeks ago #131994 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Only use specific fields in user profile
Extended User Fields might not work for you out of the box.

In my opinion it is best to modify this extension, not override it but modify its code.
Replace the fields with your own in the xml file and create your own custom plugin.

Then you need to edit K2's profile.php file. Here is where the overriding takes place.
This post will help you: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

Once you have moved the appropriate file, comment out the fields you do not want your used to edit.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum