Web developer resources
Help more people take part in research
Be Part of Research is an online service which aims to connect members of the public, patients, clinicians, health and social care professionals with all the information they need to take part and support health and care research in England.
We’ve produced a widget which you can place on your website, blog or other digital space to help promote our site and participation in research.
Use the text below to explain the site.
What is Be Part of Research?
Be Part of Research is an online service which connects public, patients, clinicians and healthcare professionals with health and care research studies in England.
The widget
The Be Part of Research (BPoR) widget is available to be used on any site promoting involvement in health and care research. There is no cost involved.
It is compatible with most tech stacks. For specific instructions, please refer to the paragraph titled below, which matches the technology used by your site.
The widget looks like this:
* { --bpor-widget-border: #005eb8; }
If the above is not specified in your CSS then the component will default to #16aca7
The straight forward method (using a CDN, compatible with anything)
- Copy and paste the following into the html file of the page you would like to use the component:
<script type="module" src="https://unpkg.com/bpor-dev-resource@0.26.0/dist/bpor-widget/bpor-widget.esm.js"></script> - Copy and paste the following into the place within the html pages' body that you would like the component to appear:
<bpor-widget distance="20" query="cancer" location="York" headinglevel="h2"> </ bpor-widget >
Angular setup
- npm install bpor-dev-resource --save
- Copy and paste the following into src/app/app.module.ts:
import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core': - Add this to your @NgModule object:
schemas:[CUSTOM_ELEMENTS.SCHEMA] - In main.ts file, copy and paste in:
import {defineCustomElements} from 'bpor-dev-resource/loader';
defineCustomElements(window); - Now add the component to e.g. app.component.html:
<bpor-widget distance="20" query="cancer" location="York" > </ bpor-widget >
React setup
- npm install bpor-dev-resource --save
- Inside src/index.js (or the file where you render your React app) copy and paste the following:
import {defineCustomElements} from 'bpor-dev-resource/loader';
defineCustomElements(window); - Add the following to e.g. App.js (or whereever you want to display the component):
<bpor-widget distance="20" query="cancer" location="York" > </ bpor-widget >
Vue setup
- npm install bpor-dev-resource --save
- Inside src/index.js (or the file where you mount your root component to the DOM) copy and paste the following:
import {defineCustomElements} from 'bpor-dev-resource/loader'; - Paste the following somewhere before the place you call new Vue({}):
defineCustomElements(window); - Add the following wherever required e.g. App.vue:
<bpor-widget distance="20" query="cancer" location="York" > </ bpor-widget >
Contact us
Via our contact form or email bepartofresearch@nihr.ac.uk. Requests for the API will be considered but are subject to approval.