The @uol-widget-cards widget is to provide card links embedded within patterns following article content.
It uses the standard @uol-widget and the @uol-cards components.
Cards config is taken from the cards config, further information from the widget. Fields for each are below.
type (required): ‘cards’ title (optional): Group of cards title lead (optional): Lead sentence (HTML)
items: Array of objects, one for each item. For each item:
image: object containing src (path to image) and alternate text url: link URL title: card title text: card text
These are combined like in the following configuration example.
eg:
'context': {
'widgets': [
{
'type': 'cards',
'title': 'Title',
'lead': '<p>Lead sentence</p>',
'cards': {
'items': [
{
'image': {
'src': '/placeholders/cards/sample-1.png',
'alt': 'A super informative description'
},
'url': '#',
'title': 'Sentinel Towers',
'text': 'Modern accommodation in the west of the city'
},
{
'image': {
'src': '/placeholders/cards/sample-2.png',
'alt': 'A super informative description'
},
{% extends '@uol-widget' %}
{% block widget_content %}
{% render '@uol-cards', { cards: cards } %}
{% endblock %}
<div class="uol-widget-container uol-widget-container__">
<div class="uol-widget">
<div class="uol-widget__left-col">
<div class="uol-widget__head">
<h2 class="uol-widget__title">A single card</h2>
<div class="uol-widget__lead">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim.</p>
</div>
</div>
</div>
<div class="uol-widget__content">
<ul class="uol-cards uol-cards--count-1 uol-cards--image-layout ">
<li class="uol-cards__card uol-cards__card--with-image">
<div class="uol-cards__card__text-wrapper">
<h3 class="uol-cards__card__title">
<a class="uol-cards__card__link " href="#">
First card
</a>
</h3>
<p class="uol-cards__card__text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam malesuada in lorem eu cursus. Duis id ipsum tortor. Suspendisse imperdiet purus id varius tempus. In ac pulvinar elit, at tempus metus.</p>
</div>
<div class="uol-cards__card__image-wrapper">
<img class="uol-cards__card__image" src="/placeholders/banner/banner-03.jpg" alt="A super informative description">
</div>
</li>
</ul>
</div>
</div>
</div>
{
"widget_title": "A single card",
"widget_lead": "<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim.</p>",
"cards": {
"items": [
{
"image": {
"src": "/placeholders/banner/banner-03.jpg",
"alt": "A super informative description"
},
"url": "#",
"title": "First card",
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam malesuada in lorem eu cursus. Duis id ipsum tortor. Suspendisse imperdiet purus id varius tempus. In ac pulvinar elit, at tempus metus."
}
],
"image_layout": true
}
}