<section class="text-block" role="region" aria-labelledby="text-block-title">
<h2 id="text-block-title">Text block title</h2>
<p>The pathways have been used to develop an indicator that measures how connected to nature a person is. It’s hoped that this indicator will be adopted by national policy makers as a way of measuring the effects of interventions. The University led
this work, alongside The Wildlife Trusts, National Trust, Natural England, RSPB, and Historic England.</p>
<p>The University led this work, alongside The Wildlife Trusts, National Trust, Natural England, RSPB, and Historic England.</p>
<a href="#" class="button-outline" role="button" tabindex="0" data-scroll>
Call to action button
</a> </section>
<section class="text-block{% if hasPublishedDate %} text-block-published-date{% endif %}" role="region" {% if title %} aria-labelledby="{{ title | lower | replace({ ' ' : '-' }) }}" {% endif %}>
{% if title %}<h2 id="{% if id %}{{ id }}{% else %}{{ title | lower | replace({ ' ' : '-' }) }}{% endif %}">{{ title }}</h2>{% endif %}
{% if content %}
{{ content }}
{% else %}
{% block content %}{% endblock %}
{% endif %}
{% if calltoaction and calltoaction.length > 0 %}
{% for index, link in calltoaction %}
{% include '@button' with {
label: link.label,
href: link.href,
primary: index == 0 and calltoaction.length > 1,
hideOverlay: true
} %}
{% endfor %}
{% endif %}
</section>
{
"title": "Text block title",
"content": "<p>The pathways have been used to develop an indicator that measures how connected to nature a person is. It’s hoped that this indicator will be adopted by national policy makers as a way of measuring the effects of interventions. The University led this work, alongside The Wildlife Trusts, National Trust, Natural England, RSPB, and Historic England.</p>\n <p>The University led this work, alongside The Wildlife Trusts, National Trust, Natural England, RSPB, and Historic England.</p>",
"calltoaction": [
{
"label": "Call to action button",
"href": "#"
}
],
"hasPublishDate": null
}
/*
Buttons within text blocks in the CMS will be WYSIWYG fields
To get the hoverr styles to work we need to add the overlay html with js...
/*/
$('.text-block [class^="button"]').each(function () {
//check if an overlay exists, if not...
if ($('.button-overlay', $(this)).length == 0) {
var text = $(this).html();
$(this).html(text + '<span class="button-overlay"><span>' + text + '</span></span>');
$(this).attr('role', 'button');
}
});
.text-block {
// mixin that sets a consistent columns width
@include uod-text-column;
// start: set default intra-component spacing (units are responsive and based on em values)
@include margin-medium;
@include for-tablet-portrait-up {
@include margin-large;
}
// end: set default intra-component spacing (units are responsive and based on em values)
@include for-desktop-up {
table {
lost-offset: -2/16;
lost-column: 20/16;
}
}
&-published-date {
margin-bottom: 0;
}
}
A block of text which is contextually standalone. Includes accessible markup and features a larger visual space below the content to separate it from subsequent content. Block contents should be WYSIWYG, so multiple headings, paragraphs, basic links and lists are all supported within it.