Add a custom field to the user profile

Backend functionalities: user management, course management, reports, certificates, etc.
Post Reply
justlooking
Newbie
Posts: 9
Joined: Sun Jul 06, 2014 9:25 pm
Version: forma.lms 1.2

Add a custom field to the user profile

Post by justlooking »

Good day gurus.

I recently downloaded Forma v1.2.1, and it is fantastic! There are a lot of great features already. However, I want to add some custom fields to the User profile. For instance, I want to add a Student ID # for user. This would appear when I add a new user. It would appear on the User's profile page.

My question is: what .php files do I need to modify to achieve this? I was thinking that it would be the lib.user and lib.user_profile files under the lib folder. Are those the correct ones? Are there any others that would need to be modified to accomplish this?

Thanks in advance for assisting me with this!

William
User avatar
max
FormaLms Guru
Posts: 2759
Joined: Thu Mar 01, 2012 10:41 am
Version: forma.lms 2.4
Contact:

Re: Add a custom field to the user profile

Post by max »

Hi William

you don't need to modify anything, additional fields are a built-in feature.
Go to Administration>main>configuration>additional fields and add as many fields as you want
Assign those fields to the relevant org chart branches. If every user needs to have the same fields, just assign them to the "root" folder.
You can do that with the "db" button in the org chart section.

Additional field will also appear under the user profile, provided that
- you don't hide them to the user (it is something you could do if you want)
- the option "deactivate extended profile" is turned off (it is in administration>main>configuration>settings>user)
---------------------
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it
justlooking
Newbie
Posts: 9
Joined: Sun Jul 06, 2014 9:25 pm
Version: forma.lms 1.2

Re: Add a custom field to the user profile

Post by justlooking »

Max,

Your instructions worked perfectly! Thank you!! I saw the additional fields section previously but had no clue where to assign them to be seen. I tested it, and it's working as expected. This is great. Thanks again.

William
getit
Newbie
Posts: 3
Joined: Tue Sep 16, 2014 10:24 pm
Version: forma.lms 1.2

Re: Add a custom field to the user profile

Post by getit »

how to print an additional field? Say user age field. I want to embed this in an iframe course
User avatar
max
FormaLms Guru
Posts: 2759
Joined: Thu Mar 01, 2012 10:41 am
Version: forma.lms 2.4
Contact:

Re: Add a custom field to the user profile

Post by max »

Hi, what do you mean by printing an additional field? User fields are in the profile, I don't see how you can embed this information in a course.
---------------------
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it
getit
Newbie
Posts: 3
Joined: Tue Sep 16, 2014 10:24 pm
Version: forma.lms 1.2

Re: Add a custom field to the user profile

Post by getit »

Hello,
Say I want to return <iframe src="http://example.com/getinfo_for_user10_w ... age=<{some code to implement from formalms printing users age field}"></iframe> in a course

We could grab info from rss or other pages and return specific content for specific users or groups. Is it easy?
User avatar
max
FormaLms Guru
Posts: 2759
Joined: Thu Mar 01, 2012 10:41 am
Version: forma.lms 2.4
Contact:

Re: Add a custom field to the user profile

Post by max »

I don't know if it's easy, anyway
users have an id in the db
custom fields have an id in the db
you should find the way to get the custom field info for the current user

Not being a developer, I don't know how to help you further. Let's see what the developers here on the forum think about this idea
---------------------
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it
Post Reply