Hi everyone its Kristian here from the e creators Academy
Today I'm going to talk to you about custom profile fields
These are the fields and additional pieces of information that we can add to the users profile and collect about them
now for some people custom profile fields might simply be just for Data recording purposes
so that we want to collect some information maybe about a date of birth of each of our users
Maybe what state they've come from?
but in other cases where people want to take it a bit further a custom profile field might be used to give access to
people to certain courses
So in this example that I was going to talk about perhaps I want to record whether people have come from New South Wales
Victoria, South Australia, and so on and based off that they are going to get enrolled into certain courses
so I actually need and there's a couple of pieces to that but the main thing that I need then is to create a
Custom profile field for state that will then allow me to use the information that's held within that later down the track
So let's just have a look a little bit at what we've got here
So as an admin I've logged in and I'm under the my users tab on the left hand side and I went in to create
A new user. This is the screen that I'm looking at here
So when you have a look here through this screen, we've got all the typical Moodle fields. All those common fields profile pictures usernames passwords
first-name lastname
but in my case and in the sample that I was showing you were just talking about is that I want to be able to
Record their state so additional names nothing about state
Interests that's talking about tags are still nothing about state
Optional okay. We're getting a bit closer here, but still nothing about state. So this is where we sort of say to ourselves. Okay?
Well, we're going to need our own profile field so you can see here
We got other fields and as a profile background image, there's still nothing about state. Okay, so we need to build our own
So to do this, I'm going to go down to the administration tab. And again, I'll go back into site administration
We go across to the second tab along the users tab
Under accounts we go to user profile field so about halfway down that list and we'll click on there
Now there's two sections to our profile fields
We can create our own profile categories
which is sort of like the folder structures as you can see here other fields is a profile category and
Then within each of those categories we can then add fields themselves
So we can have one or many categories
It's totally up to you. And these categories will show in that collapsible form when you go to create a new user
Now if you do create a profile category and you don't have any fields within it, it won't show up
So it'll remain invisible when you're trying to create a user so just keep that in mind if you've gone and created a category
But didn't put anything in it. It won't actually display. So you haven't done anything wrong
It's just that you've always need a field at least one within a category for it to show up
So I'm not gonna use the other fields one
I'm going to create a category called ear creators, for example, so I clicked on the create a new category
And I'm just going to call it ear creators and I'm gonna click the Save Changes now
You could call it whatever you like
You could call it your state if you want if there was only going to be just that one field in there
So you're currently showing here. I have two categories. Now one called other fields, which has the profile background image in it
And then the e creators category, which is now I can choose from as to what fields I want to put in there
So if you look at the bottom of this page here
We create a new profile field and we can choose any one of these types. So is it just simply a checkbox?
Is it a time and date range?
So maybe is the date the employer you started maybe their birth date maybe the day they completed their induction
Whatever it might be
I've dropped down me which is very typically used especially if we're integrating this with giving them permissions to something else
Because the thing with the drop-down menu is that it keeps data accurate
So, you know
If for example I had someone that was from New South Wales
one person might write at NSW the other person might write New South Wales and I'm gonna have to capture all these
Different versions. So by having a drop-down menu, it means that I can keep it exact a
file upload area a text area or a text input
So this is basically just the difference between a text box and just one line of text. So that's the difference there
So in my case because I want accuracy. I'm going to say drop down menu
Now the short name so this is what the database uses so in my case, I'm just going to call it the state field
The name is what the user sees
so the short name is what the database uses and what we use when we do bulk uploading in the CSV file and
The name is what the user see. So that's where it's grammatically correct capital letters. All those are the things a
Description of the field if you want. You're welcome to add it there and
Then just a couple of other options
So is the field required is the field locked?
therefore does that mean that the user can actually access that data and edit it or is it just only
The uploads that can do that should the data be unique. So can anybody else have the same answer?
Should we display it on the signup page which links with the actual self email based registration?
Who is the field visible to and what category is that field actually going in?
So you can select all of that there just one little thing
I do want to talk about here is is this field required?
Just remember and be careful with this one if you say yes to that and actually toggle that to yes
if there is existing users already in the system the first logging
after this has been set to yes is going to take them straight to their profile page and
Every user will have to answer this question
Because basically the database is now looking at all these records saying I have a required field and for all these users
It's empty
So before we can continue
They must complete it
Now that can be a little bit confusing for users sometimes
Because they're going and logging into the system and suddenly now
They're being taken straight to their user profile page and they're not quite sure what to do
So if you are going to introduce a new required field just make sure that you communicate that out to all your users
So they know exactly what's going on. And what's going to be expected of them
Alright so as we move down the page a bit further we can then go to
Our options so the specific settings around this so as it says there one per line
So these are all the options that are here in that drop-down
So here all my states and if I want I can provide a default value
so this is one that it will always be selected and
The user can then change it from that if they're going to be using other one
So mostly your default value would be the most common item that's going to be selected and we click Save Changes
So as you can see we've now set up a new category and we've also set up a new profile field called state
so if I was to go across and create a new user so under my
Users on the left hand side and click create new user
You'll now see how this looks so the effect shows so the changes take effect straight away. So here's the other field drop-down and then
Here's the e creators one that we've just created there's the state which is selected as Victoria by default
drop-down and we can now select from all the others within that list and
You're done. So thanks for watching. I hope that's helped in giving you a bit more information about custom profile fields
Just remember there is a lot of things that we can do to automate these as well
So this is where we talked about using the advanced code what's option in which we can enroll people into courses based off
Answers to certain custom profile fields within their profile
There's a lot of different options and there's lots more help articles and videos from us around this as well
So, I hope that's helped and we'll talk to you soon
Không có nhận xét nào:
Đăng nhận xét