Page 1 of 1

Add a custom field to the user profile

Posted: Sun Jul 06, 2014 9:47 pm
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

Re: Add a custom field to the user profile

Posted: Mon Jul 07, 2014 8:37 am
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)

Re: Add a custom field to the user profile

Posted: Tue Jul 08, 2014 5:06 am
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

Re: Add a custom field to the user profile

Posted: Wed Sep 24, 2014 7:10 pm
by getit
how to print an additional field? Say user age field. I want to embed this in an iframe course

Re: Add a custom field to the user profile

Posted: Wed Sep 24, 2014 7:18 pm
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.

Re: Add a custom field to the user profile

Posted: Thu Sep 25, 2014 7:16 pm
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?

Re: Add a custom field to the user profile

Posted: Thu Sep 25, 2014 8:15 pm
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