# Exercise 8.7: Set up profile fields

Previously, you added fields to content types. You can also add fields to user profiles. This means you can let users share information about themselves and then you can display it. You can also control permissions so only trusted users can see profiles. Below you can see the profiles will have a text field for description and also a list of interests and a profile picture.

![Image of User profile with image](/files/n2yfNEmQJJICLoaU9KBH)

## Add a text field for a biography

1. Go to *Configuration* → *People* → *Account settings* → **Manage fields**.
2. This interface is similar to the one for adding fields to content, now you can Add a new field with the following settings:
3. **Type:** Text → Text (plain, long)
4. **Label:** About me
5. **Machine Name:** field\_about\_me
6. Go to the **Manage form display** tab and set the **Widget** for About me to: *Text area (multiple rows)*.

   <img src="/files/h3WkucblY3IEL4NPFjnM" alt="Image of User profile with image" data-size="original">
7. Review the User settings. We will keep all the default settings, however, review the options before you save.
8. Click Save settings.

## Add a taxonomy field for interests

We need to create a new “Interests” vocabulary we can use in this case.

1. Go to *Structure* → *Taxonomy* → **Add vocabulary**.
2. **Name:** Interests
3. **Save** the vocabulary
4. At this stage we can decide not to add any terms to the vocabulary, rather rely on users to add them when they create or update their profile.
5. Go back to *Configuration* → *People* → *Account settings* → **Manage fields**.
6. **Add** a new field:

   * **Type:** Reference → Taxonomy term
   * **Label**: Interests
   * **Allowed number of values:** Unlimited
   * **Create referenced entities if they don't already exist:** Yes
   * **Vocabulary**: Interests

   <img src="/files/uN6qb3jQwYqPmWuFlR2F" alt="Image of User profile with image" data-size="original">

   * **Widget:** Select *Autocomplete (Tags style).* This can be configured after you add the field, from the *Manage form display* tab.
   * **Save** settings.

## Test by editing your account

Return to the front page.

1. Click **Your username** in the top administration menu, then *View profile*, then the **Edit profile** tab.

   <img src="/files/9qDO6FdA4kprGxLYsw6F" alt="Image of Edit profile page" data-size="original">
2. At the bottom of the form you can see the options available.
3. Fill in some text for **About me** and type in tags (comma-separated for multiple tags) for **Interests**, such as *Jogging, Sailing, Drupal.*
4. Under **Picture**, upload an image if you haven't already.
5. Save.

Click the **View** tab and now you can view the admin profile.

You can also manage the display of the fields, for example hiding the label. As your Drupal skills improve, you can make changes to the site design through *Theming* to alter the way this information looks; or change what displays through *Manage display* configuration pages.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://salsa-digital.gitbook.io/govcms-site-builder/unit-8-site-building-exercises/employee-list-and-custom-profiles/exercise-8-7-set-up-profile-fields.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
