The @uol-multilink-results-item provides a summary of a person’s details and contains a link to their full profile page. This guidance is for the implementation of one results item, to display multiple items use the @uol-multilink-results-items component.
Use when a page will only ever display one results item. As an example, an author’s profile on a blog post. If multiple items are intended to be displayed, such as in a group of staff members, then use the @uol-multilink-results-items.
Do not use in instances where there will be multiple items to display, use @uol-multilink-results-items for instances where the number of items to be displayed in a group exceeds one.
heading_level
is optional, if it is set it should be set using the correct hierarchy, considering the page’s existing heading structure, otherwise it will default to <h3>
. The heading level should be reflect any changes in the overall page heading outline.
example:
'context': {
'heading_level': 'h3',
...
Example:
'context': {
...
'item': {
...
}
}
The following sections detail required and optional parameters which can be added to an item object. A full example including all parameters is provided below.
Required parameter ‘person_name’: Person’s name.
Optional parameter ‘img’: The image should be .jpg format with dimensions 344px x 344px. The image content data should be the relative path to the image location.
Optional parameter ‘url’: Relative or absolute link to the person’s profile page.
Optional parameter ‘position’: The staff member’s position within the organisation.
Optional parameter ‘lead_para’: Optional sentence before specialisms and categories.
Optional parameter ‘specialisms’: An array of objects with each specialism set by the label value. Displayed as comma separated list following a ‘Area of expertise’ or ‘Areas of expertise’ if more than one item.
eg. ‘specialisms’: [ {‘label’: ‘Deafness in childhood and young people (0-25 yrs)’}, {‘label’: ‘Language development’} ]
Optional parameter ‘additional’: An array of objects to show other title / value pairs. This could display information such as module code or location.
eg. ‘additional’: [ { ‘term’: ‘Category label’, ‘data’: [{‘label’: ‘Category information’}] }, ],
The above example shows this as ‘Category label: Category information’. Further objects added to this array display further title / value pairs.
Optional parameter ‘email’: Person’s email address (will act as an active link to default email) .
Optional parameter ‘phone’: This should take one of two formats ‘+44(0)113 343 5000’ or ‘0113 343 5000’. Using either of these formats will result in the device being an active link placing a call on an applicable device.
Optional parameter ‘close_para’: Optional sentence before specialisms and categories.
Each item can have one or multiple optional “Actions” and or “Messages”.
Actions are intended to be used to provide interactivity to a results item e.g., “Connect”, “Save”, “Edit” etc.
Each action is rendered as a button and supports all @uol-button configuration options.
NB: Although it is technically possible to render an “icon-only” button, you must not do so in this context.
Messages are intended to provide post interaction confirmation (e.g. “You messaged this user on [DATE]” ) or status information (e.g. “User last active X days ago”).
Messages are rendered using @uol-status-message
A full example of an item to display is as follows (this example omits the heading_level
) and it will be automatically set as h3
:
'context': {
'item': {
'person_name': 'Tony Bailey',
'img': '/placeholders/ph-profile-staff-01.jpg',
'url': '#',
'position': 'Associate Professor in Inclusive Education (SEND) with expertise in Deaf Education',
'lead_para': 'Lead sentence. Lorem ipsum dolor sit amet, consectetur adipisicing elit.',
'specialisms': [
{
'label': 'Deafness in childhood and young people (0-25 yrs)'
},
{
'label': 'Language development'
}
],
'additional': [
{
'term': 'Category label',
'data': [
{'label': 'Category information'}
]
}
],
'email': 'bailey92@techholic.in',
'phone': '+44(0)113 343 5000',
'close_para': 'Closing sentence. Lorem ipsum dolor sit amet, consectetur adipisicing elit.',
'messages': [
{
'text': '<strong>Email sent</strong> 22 November 2022',
'type': 'success'
},
{
'text': 'Response received',
'type': 'info'
}
],
'actions': [
{
'id': 'button-unique-id-1',
'style': 'primary',
'type': 'button',
'name': 'contact',
'content': 'Contact',
}
]
}
<li class="uol-multilink-results">
<div class="uol-multilink-results__image-titles">
{% if item.img %}
<img class="uol-multilink-results__image" src="{{ item.img }}" alt="Profile picture of {{ item.person_name }}">
{% endif %}
{# TODO: remove dependency on id in this file and JS #}
<div class="uol-multilink-results__alongside-image {% if item.img %}uol-multilink-results__has-image{% endif %}">
<div class="uol-multilink-results--titles">
<{{ heading_level if heading_level else 'h3' }} class="uol-multilink-results__name">
{% if item.url%}
<a href="{{ item.url }}">{{ item.person_name }}</a>
{% else %}
{{ item.person_name }}
{% endif %}
</{{ heading_level if heading_level else 'h3' }}>
</div>
</div>
</div>
{# TODO: remove dependency on id in this file and JS #}
<div class="uol-multilink-results__below-image">
{% if item.position %}
<strong class="uol-multilink-results__position">{{ item.position }}</strong>
{% endif %}
<div class="uol-multilink-results--further">
{% if item.lead_para %}
<p class="uol-multilink-results__paragraph">{{ item.lead_para }}</p>
{% endif %}
{% if item.specialisms.length %}
{% set expertiseLabel = 'Areas of expertise' if item.specialisms.length > 1 else 'Area of expertise' %}
{% render '@uol-info-list', {
'info_list': [
{
'term': expertiseLabel,
'data': item.specialisms
}
]
} %}
{% endif %}
{% render '@uol-info-list', { 'info_list': item.additional } %}
{% if item.email or item.phone %}
{% render '@uol-info-list', {
'info_list_style': 'inline',
'info_list': [
{
'term': 'Email',
'data': [
{
'type': 'email',
'label': item.email
}
]
},
{
'term': 'Phone',
'data': [
{
'type': 'phone',
'label': item.phone
}
]
}
]
} %}
{% endif %}
{% if item.close_para %}
<p class="uol-multilink-results__paragraph">{{ item.close_para }}</p>
{% endif %}
</div>
</div>
{% if item.messages or item.actions %}
<div class="uol-multilink-results__footer">
{% if item.messages %}
<div class="uol-multilink-results__footer__messages">
{% for message in item.messages %}
{% render '@uol-status-message', message %}
{% endfor %}
</div>
{% endif %}
{% if item.actions %}
<div class="uol-multilink-results__footer__actions">
{% for action in item.actions %}
{% render '@uol-button', action %}
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
</li>
{#
<{{ heading_level if heading_level else 'h3' }} class="uol-multilink-results__name">
{% if item.url%}
<a href="{{ item.url }}">{{ item.person_name }}</a>
{% else %}
{{ item.person_name }}
{% endif %}
</{{ heading_level if heading_level else 'h3' }}>
{% if item.img %}
<img class="uol-multilink-results__img" src="{{ item.img }}" alt="Profile picture of {{ item.person_name }}">
{% endif %}
<strong class="uol-multilink-results__position">{{ item.position }}</strong>
{% if item.specialisms.length %}
{% set expertiseLabel = 'Areas of expertise' if item.specialisms.length > 1 else 'Area of expertise' %}
{% render '@uol-info-list', {
'info_list': [
{
'term': expertiseLabel,
'data': item.specialisms
}
]
} %}
{% endif %}
{% if item.email or item.phone %}
{% render '@uol-info-list', {
'info_list_style': 'inline',
'info_list': [
{
'term': 'Email',
'data': [
{
'type': 'email',
'label': item.email
}
]
},
{
'term': 'Phone',
'data': [
{
'type': 'phone',
'label': item.phone
}
]
}
]
} %}
{% endif %}
{% render '@uol-info-list', { 'info_list': item.additional } %}
{% if item.messages or item.actions %}
<div class="uol-multilink-results__footer">
{% if item.messages %}
<div class="uol-multilink-results__footer__messages">
{% for message in item.messages %}
{% render '@uol-status-message', message %}
{% endfor %}
</div>
{% endif %}
{% if item.actions %}
<div class="uol-multilink-results__footer__actions">
{% for action in item.actions %}
{% render '@uol-button', action %}
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
</{{ 'li' if multiple else 'div' }}> #}
<li class="uol-multilink-results">
<div class="uol-multilink-results__image-titles">
<div class="uol-multilink-results__alongside-image ">
<div class="uol-multilink-results--titles">
<h3 class="uol-multilink-results__name">
<a href="#">Isla Ellis</a>
</h3>
</div>
</div>
</div>
<div class="uol-multilink-results__below-image">
<strong class="uol-multilink-results__position">Lecturer in Algebra</strong>
<div class="uol-multilink-results--further">
<div class="uol-info-list-container">
<dl class="uol-info-list ">
<div class="uol-info-list__group">
<dt class="uol-info-list__term ">Areas of expertise</dt>
<dd class="uol-info-list__data ">
Higher Lie and gauge theory
</dd>
<dd class="uol-info-list__data ">
Higher dimensional category theory
</dd>
<dd class="uol-info-list__data ">
Hopf algebras
</dd>
<dd class="uol-info-list__data ">
Quantum invariants of knots and manifolds
</dd>
<dd class="uol-info-list__data ">
Topological quantum computing
</dd>
<dd class="uol-info-list__data ">
Modelling topological phases of matter
</dd>
</div>
</dl>
</div>
<div class="uol-info-list-container">
<dl class="uol-info-list ">
<div class="uol-info-list__group">
<dt class="uol-info-list__term ">Favourite colour</dt>
<dd class="uol-info-list__data ">
Blue
</dd>
</div>
<div class="uol-info-list__group">
<dt class="uol-info-list__term ">Favourite foods</dt>
<dd class="uol-info-list__data ">
Pizza
</dd>
<dd class="uol-info-list__data ">
Curry
</dd>
</div>
</dl>
</div>
</div>
</div>
</li>
.uol-multilink-results {
list-style: none;
margin-bottom: $spacing-4;
padding: $spacing-5 $spacing-4;
border: 1px solid $color-border--light;
border-radius: 6px;
background-color: $color-grey--faded;
font-variant-numeric: lining-nums;
color: $color-font;
overflow: auto;
@include media(">=uol-media-m") {
padding: $spacing-5 $spacing-4;
}
@include media(">=uol-media-l") {
padding: $spacing-5;
}
.uol-info-list {
margin: $spacing-2 0 0 0;
}
}
.uol-multilink-results__alongside-image {
max-width: 784px;
}
.uol-multilink-results__has-image {
margin-top: $spacing-4;
margin-left: $spacing-4;
@include media(">=uol-media-m") {
margin-top: 0;
margin-left: $spacing-4;
}
@include media(">=uol-media-l") {
margin-left: $spacing-5;
}
@include media(">=uol-media-xl") {
margin-left: $spacing-6;
}
}
.uol-multilink-results__image-titles {
display: flex;
}
.uol-multilink-results__image {
border-radius: 50%;
width: 116px;
height: 116px;
margin-bottom: $spacing-2;
@include media(">=uol-media-m") {
width: 156px;
height: 156px;
}
@include media(">=uol-media-l") {
width: 161px;
height: 161px;
}
@include media(">=uol-media-xl") {
width: 179px;
height: 179px;
}
@include media(">=uol-media-xxl") {
width: 215px;
height: 215px;
}
}
.uol-multilink-results__name {
font-size: 1.375rem;
@include media(">=uol-media-m") {
font-size: 1.75rem;
}
font-family: $font-family-serif;
margin: 0;
a {
text-decoration: none;
&:hover,
&:focus {
text-decoration: underline;
outline: 3px dotted transparent;
}
}
}
.uol-multilink-results__position {
@extend %text-size-heading-6;
display: block;
font-family: $font-family-serif;
color: $color-brand;
margin-top: $spacing-2;
}
.uol-multilink-results--further {
margin-bottom: $spacing-2;
}
.uol-multilink-results__paragraph {
@extend %text-size-paragraph--small;
margin: $spacing-2 0 0;
}
.uol-info-list {
@extend %text-size-paragraph--small;
}
.uol-status-message:last-child {
margin-bottom: -#{$spacing-2};
}
.uol-info-list--inline {
.uol-info-list__group:not(:last-child) {
margin-right: $spacing-3;
margin-bottom: $spacing-2;
}
// to allow for correct gaps for when switches to and from in a row to in a column
@include media(">=uol-media-m") {
margin-bottom: -#{$spacing-2} !important;
}
}
.uol-multilink-results__footer{
padding: $spacing-4 0 0;
&:before {
content: "";
display: block;
width: 100%;
height: 1px;
background-color: $color-border--light;
}
}
.uol-multilink-results__footer__messages {
@extend %text-size-paragraph--small;
display: block;
padding-top: $spacing-5;
.js & svg {
height: 1.5em;
width: 1.5em;
min-width: 1.5em;
margin-top: 0;
margin-left: 0;
}
}
.uol-multilink-results__footer__actions {
margin-bottom: -#{$spacing-5};
padding-top: $spacing-5;
.uol-button {
margin: 0 $spacing-4 $spacing-5 0;
}
}
/*
TODO:
Remove dependency on hardcoded ids
Generate unique ids
*/
export const multilinkResultsItem = () => {
const multilinkResultsItemGroup = document.querySelectorAll('.uol-multilink-results');
let count = 0;
multilinkResultsItemGroup.forEach( (multilinkResultsItem) => {
// set unique ids
// container alongside image
let alongsideElement = multilinkResultsItem.getElementsByClassName("uol-multilink-results__alongside-image")[0];
let alongsideElementId = "alongsideImage-" + count;
alongsideElement.setAttribute("id", alongsideElementId);
// container below image
let belowElement = multilinkResultsItem.getElementsByClassName("uol-multilink-results__below-image")[0];
let belowElementId = "belowImage-" + count;
belowElement.setAttribute("id", belowElementId);
// content which switches
let furtherElement = multilinkResultsItem.getElementsByClassName("uol-multilink-results--further")[0];
let furtherElementId = "further-" + count;
furtherElement.setAttribute("id", furtherElementId);
// area person works in (red subtitle)
let areaElement = multilinkResultsItem.getElementsByClassName("uol-multilink-results__position")[0];
let areaElementId = "area-" + count;
areaElement.setAttribute("id", areaElementId);
const width = window.innerWidth;
let position = "below";
let areaPosition = "below";
const windowResize = () => {
checkResolutionMoveTarget();
}
window.addEventListener('resize', windowResize);
const moveToAlongsideImage = () => {
position = "alongside";
let fragment = document.createDocumentFragment();
fragment.appendChild(document.getElementById(furtherElementId));
document.getElementById(alongsideElementId).appendChild(fragment);
}
const moveToBelowImage = () => {
position = "below";
let fragment = document.createDocumentFragment();
fragment.appendChild(document.getElementById(furtherElementId));
document.getElementById(belowElementId).appendChild(fragment);
}
// job title
const moveAreaToAlongsideImage = () => {
areaPosition = "alongside";
let fragment = document.createDocumentFragment();
fragment.appendChild(document.getElementById(areaElementId));
document.getElementById(alongsideElementId).appendChild(fragment);
}
const moveAreaToBelowImage = () => {
areaPosition = "below";
let fragment = document.createDocumentFragment();
fragment.appendChild(document.getElementById(areaElementId));
document.getElementById(belowElementId).prepend(fragment);
}
if (width < 768 && areaPosition == "alongside") {
moveAreaToBelowImage();
}
if (width >= 768 && areaPosition == "below") {
moveAreaToAlongsideImage();
}
if (width < 768 && position == "alongside") {
moveToBelowImage();
}
if (width >= 768 && position == "below") {
moveToAlongsideImage();
}
const checkResolutionMoveTarget = () => {
const width = window.innerWidth;
if (width < 600 && areaPosition == "alongside") {
moveAreaToBelowImage();
}
if (width >= 600 && areaPosition == "below") {
moveAreaToAlongsideImage();
}
if (width < 768 && position == "alongside") {
moveToBelowImage();
}
if (width >= 768 && position == "below") {
moveToAlongsideImage();
}
}
checkResolutionMoveTarget();
count ++;
})
}
{
"heading_level": "h3",
"item": {
"url": "#",
"person_name": "Isla Ellis",
"position": "Lecturer in Algebra",
"specialisms": [
{
"label": "Higher Lie and gauge theory"
},
{
"label": "Higher dimensional category theory"
},
{
"label": "Hopf algebras"
},
{
"label": "Quantum invariants of knots and manifolds"
},
{
"label": "Topological quantum computing"
},
{
"label": "Modelling topological phases of matter"
}
],
"additional": [
{
"term": "Favourite colour",
"data": [
{
"label": "Blue"
}
]
},
{
"term": "Favourite foods",
"data": [
{
"label": "Pizza"
},
{
"label": "Curry"
}
]
}
]
}
}