Documentation

Employee Directory settings and Mini Profile format

Sort employees by first or last name

You can choose whether the employee directory sorts by first or last name with the configuration setting employee.directory.sortByFirstName

  1. Go to the Administration panelAdvanced options section > Configuration settings page.
  2. Type employee in the Search config settings field to narrow the list of configuration settings.
  3. Find the config setting employee.directory.sortByFirstName
  4. Click in the Value column and two options will appear:
    1. Select true to have the employee directory sort by first name.
    2. Select false to have the employee directory sort by last name.
  5. Click Save.
Choosing true for this configuration setting will sort the results by first name, but will not make a user's first name appear before their last name in the employee directory listing. To control the name order within the individual employee directory listing, see the heading Employee Directory listing and mini profile format below.

Choose number of employee results per page

You can choose how many employee directory listings will appear on each page with the configuration setting employee.directory.resultsPerPage. The default value is 100.
  1. Go to the Administration panelAdvanced options section > Configuration settings page.
  2. Type employee in the Search config settings field to narrow the list of configuration settings.
  3. Find the config setting employee.directory.resultsPerPage.
  4. Click in the Value column and a text box will appear.
  5. Enter the number of employee listings that you want to appear on each page.
  6. Click Save.

Change the Excel export template for People Directory 

To learn more, see the page How to change the Excel export template for People Directory.

Employee Directory listing and mini profile format

Both the Employee Directory listing format and the Mini Profile (which appears when you hover your cursor over a user's name) format can be customized to display the style and information that you want.

Example Employee Directory listing

people%20directory%20entry.png

Example Mini Profile

mini%20hover%20profile.png

To access the Employee Directory listing template on your ThoughtFarmer site go to the Administration panelUsers & security > People directory user template. To access the Mini Profile user template, go to /admin/miniprofiletemplate.

Any customizations to the templates should be tested on upgrade to future releases of ThoughtFarmer.

The new templating language used is called mustache. Here is an overview of mustache syntax.

Variables

Variables are used within the template as place holders for where the actual data will go. You can use variables in combination with any other valid HTML to display the information the way you like. There are two types of variables used: labels and values. Labels can be accessed using a variable passed into the template, i.e. {{label.firstName}}. Using these labels rather than simple text ensures that the localized value of the label is displayed based on the user's settings. The template comes with a number of prepopulated labels and values explained below.

Default Employee Directory listing template value

 <tr>
    <td class="photo">
        <a href="{{url}}"><img src="{{profilePhotoUrl}}" alt="{{fullName}}" style="width: 60px; height: 60px;"></a>
    </td>
    <td>
    <h3><a href="{{url}}">{{fullNameLastNameFirst}}</a>{{^isActive}}<span class="inactive">[{{label.inactive}}]</span>{{/isActive}}<span class="jobTitle">{{jobTitle}}</span></h3>
    <div class="clearfix">
        <ul>
            {{#email}}<li><span>{{label.email}}:</span>{{email}}</li>{{/email}}
            {{#phone}}<li><span>{{label.phone}}:</span>{{phone}}</li>{{/phone}}
        </ul>
    </div>
    </td>
</tr>
The default template is a good starting place to work from when making customizations. It contains a number of examples of usage of the labels and values.

Default Mini Profile user template value

<div>
        <div class="ui-miniprofile-content clearfix">
                <div class="ui-miniprofile-photo">
                        <img src="{{profilePhotoUrl}}" />
                </div>
                <div class="ui-miniprofile-name">
                        <a class="block font-16" href="{{url}}">{{fullName}}</a>
</div> <ul class="ui-miniprofile-details"> {{#jobTitle}}<li class="medium-grey margin-bottom-5">{{jobTitle}}</li>{{/jobTitle}} {{#phone}}<li><strong class="margin-right-5">{{label.phone}}:</strong><span>{{phone}}</span></li>{{/phone}} {{#email}}<li><strong class="margin-right-5">{{label.email}}:</strong><a href="mailto:{{email}}">{{email}}</a></li>{{/email}} </ul> </div> </div>
The default template is a good starting place to work from when making customizations. It contains a number of examples of usage of the labels and values.

Available labels and values

As of version 6.6, pressing CTRL + SPACE when inside the editor will provide you with an autocomplete list of possible template values. This autocomplete list includes:
  • variables (raw values)
  • list items (containing the full item's syntax wrapped in an HTML list item)
  • custom fields
This is very useful for customizing your template, as it allows you to add fields without having to type them in.

Available labels

{{label.nickname}}
{{label.jobTitle}}
{{label.email}}
{{label.firstName}}
{{label.lastName}}
{{label.name}}
{{label.birthday}}
{{label.phone}}
{{label.mobile}}
{{label.fax}}
{{label.status}}
{{label.address}}
{{label.memberOf}}
{{label.manager}}

Available values

{{userId}}
{{isActive}}
{{fullName}}
{{firstName}}
{{lastName}}
{{fullNameLastNameFirst}}
{{jobTitle}}
{{phone}}
{{mobile}}
{{fax}}
{{url}}
{{profilePhotoUrl}}
{{email}}
{{status}}
{{groups}}
{{manager}}
{{label}}

Custom field variables

Custom fields can also be displayed on the Employee Directory and the Mini Profile. To do so you need to use the template name of the custom field instead of the labels. See User Profile Custom Fields for more info. The syntax to access the value stored in that custom field is:
{{customField.CustomFieldName.value}}
Note: Your custom field template id must be in camel case letters.

For example, a custom field called "skills" under heading "Experience", you can access this value using:
{{customField.skills.value}}
Localized custom field labels are not currently supported. Labels for custom fields in the template will need to use simple text.

Basic usage

Each employee listing is nested inside a table row. The custom template must use the <tr> and <td> elements as their starting point for customization.

Basic labels and values can be output as lists. For example, to simply display a user's email address you can put:
 <li>{{email}}</li>
or for a custom field:
 <li><span>{{customField.skills.label}}:</span> {{customField.skills.value}}</li>
In the above examples the span tags are used to apply the ThoughtFarmer default styling for a field label. You can use your own styling here if you wish.

Certain fields contain HTML, and when enabling them you have to take additional steps to ensure the HTML is correctly escaped before rendering.

To do this, add an addition curly bracket around the variable you are attempting to output.
 <li><span>Member of:</span> {{{groups}}}</li>

Conditional statements

Sometimes users do not fill in all of the information in their profile. To avoid displaying empty fields with their corresponding label, you can use conditional statements to hide / show these values.
 {{#email}}{{email}}{{/email}}
In this example, we are checking to see if the value for email for this user is not empty. If it is not empty, then the value will be displayed.
 
Ensure that if the field contains HTML, you are adding an additional curly bracket around the variable to be output.

If your field does contain HTML, note that you only need the additional curly bracket around the inner value that is being output, not the surrounding values.
 {{#groups}}<li><span>{{label.groups}}:</span>{{{groups}}}</li>{{/groups}}