DEV Community

hediyeh kianmehr
hediyeh kianmehr

Posted on

Adding a Custom Attribute to the User’s Template-Based View

Overview

This guide provides a step-by-step process for adding custom attributes to a user’s Template-Based View. It covers creating custom fields, assigning them to appropriate sections, and ensuring they are visible in the Template-Based View.


Table of Contents

  1. Overview
  2. Template-Based View
  3. Additional Information
  4. Create a Custom Field
    1. Mandatory Fields
    2. Checkbox Options
    3. Custom Field Type
  5. Create a Text Field Custom Attribute
    1. Text Field Options
  6. Page Template Configuration
  7. Add Custom Attribute to Template
  8. Verify Custom Attribute

In the search bar, locate the user account to which you want to add a Custom attribute.


Template based view

We chose the Template-Based View because it allows us to provide information to the user.


Additional Information

In the Additional Information section, we want to add Custom attributes. The values for these attributes will be retrieved from Active Directory and displayed in this section.


Create a Custom Field

First, click on the Administration tab and select Custom Fields.


Choose Create New Custom Field.


Mandatory Fields

You must complete all mandatory fields (marked with *) in order to create a custom field.

Field Name: Set the internal name for your custom field. This value is not displayed to end users.

(Based on the setup)

Field Name: Custom attributes


Display Name English: Enter the display name for the field. This is the label shown to users in the interface.

(Based on the setup)

Display Name English: company attributes


Checkbox Options

There are several checkboxes you can configure based on your requirements:

  • Is Editable Allows the end user to edit the field.
  • Is Public Determines whether the field is visible to all users.
  • Is Required Makes the field mandatory the user must provide a value before saving.

(Based on the setup)
Is Public: Checked


Custom Field Type

The Type of Custom Field: This defines the type of the custom field you are creating.

(Based on the setup)

The Type of Custom Field Section

Section: It helps organize fields into logical groups for better readability and usability.

Note:
You can select other field types depending on the system configuration.

Then, click Save to create the custom attribute in the User’s Template-Based View.


Create a Text Field Custom Attribute

Choose Create New Custom Field once more.

In this step, create a new custom field that will belong to the Company Attributes section you created earlier (based on the setup).

  • Field Name: company_floor
  • Display Name English: floor
  • Is Public: Checked

  • The Type of Custom Field Text Field

Text Field Options

  • Text Field: standard text input.

If you choose Text Field as the type, additional options will appear:

  • Field Placeholder: Enter a placeholder text that will appear inside the field before the user types anything.

  • Default Value: You can add any data you want in the fields of this section.

  • English: enter the desired value

(based on the setup)
English: 2

Note:
The value assigned to the custom field can also be sourced from Active Directory through a script and the synchronization process.


Page Template Configuration

click on the Administration tab and select Page Template.

Here, you should select the Page Template you want to use.

Navigate to the Actions column and click Edit next to the Page Template you wish to modify.


Add Custom Attribute to Template

In the Template Fields section, search for the custom attribute you created earlier.

Click Add to List to include it, and you will see your custom attribute appear in the list.

Then, click Save

Note:
The order of adding custom attributes to the list is important. Sections should be added first, followed by the custom fields that belong to each section.


Verify Custom Attribute

Now, we can verify whether the custom attribute has been added to the user’s Template-Based View.

Search for the name of the user to whom you added a custom attribute in the search bar.

Choose Template-Based View.


Additional Information

Verify that in the Additional Information section:

  • The Company Attributes section is displayed as the organized group.
  • The custom field Floor appears within this section.

Top comments (0)