The [people] shortcode puts staff cards on any page: one person, such as the owner of a policy, or everyone in a team, such as the HR advisers on the HR landing page. Each card shows the person’s photo, name, job title and telephone number, and links to their profile in the staff directory. The cards use the same details as the staff directory, so they stay correct when people update their profiles.
The shortcode is only available when the Staff directory module is switched on under Options, then Modules. See Setup the staff directory.
Add the people shortcode
Type the shortcode where the cards should appear, in the Classic Editor:
[people team="press-office"]
Or select the Insert shortcode button on the editor toolbar, choose People, fill in the boxes and select Insert.
Attributes of people
id
Optional. Shows one person. Give either their user ID, from the Users screen (the number after user_id= in the address bar when editing them), or their email address, which is easier: id="jane.smith@example.gov.uk". When id is given, team and num are ignored. If no user matches, nothing is shown.
team
Optional. Shows everyone whose profile lists that team. Give the team’s slug, the last part of the team page’s web address after /team/, such as press-office. For a team inside another team the slug alone is enough; the full path, such as communications/press-office, and the team’s ID number also work. People in the team’s sub-teams are included, as on the team page, so a shortcode for Communications also lists Internal Communications.
Check the result after publishing. If the team cannot be found, or nobody has it on their profile, the shortcode shows nothing at all, so a blank space where you expected cards usually means a mistyped team.
num
Optional. The most people to show. The default, -1, shows everyone in the team. Use it with a team to show, say, the first four.
With no attributes at all, [people] shows nothing. It needs either a person or a team.
What people shows
Staff cards in two columns, each linking to the person’s profile. A card shows the photo, name and job title, then the telephone number if there is one. Two more details depend on settings on the Staff directory tab of Options, then Modules: the grade appears when Show grade on staff cards is on, and the mobile number when Show mobile on staff cards is on. Both are off by default.
People are in name order: by first name, or by last name when Directory name order on the same tab is set to Last name. Users who are hidden from the directory are left out of team lists; see Hide users. A team list is cached, so a change to someone’s profile may take up to an hour to show on the page.
Examples of people
The policy owner, by email address:
[people id="jane.smith@example.gov.uk"]
The same person by user ID:
[people id="212"]
Everyone in the press office, a top-level team:
[people team="press-office"]
The first four people in the payroll team, which sits inside finance:
[people team="finance/payroll" num="4"]
Related
- Display a list of users by tag: staff cards for people with a profile tag, such as first aiders, grouped by location.
- Setup the staff directory.
- Module settings and options: the Staff directory tab.
