Guidance

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.

Configuration

Cards config is taken from the cards config, further information from the widget. Fields for each are below.

Widget settings

type (required): ‘cards’ title (optional): Group of cards title lead (optional): Lead sentence (HTML)

Cards settings

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

Configuration example

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">
    <div class="uol-widget">

        <div class="uol-widget__left-col">

            <div class="uol-widget__head">

                <h2 class="uol-widget__title">A collection of 6 cards (featured)</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--featured uol-cards--count-6 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-04.jpg" alt="A super informative description">

                    </div>

                </li>

                <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="#">

                                Second 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-01.jpg" alt="">

                    </div>

                </li>

                <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="#">

                                Third 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-02.jpg" alt="A super informative description">

                    </div>

                </li>

                <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="#">

                                Fourth 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">

                    </div>

                </li>

                <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="#">

                                Fifth 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-05.jpg" alt="">

                    </div>

                </li>

                <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="#">

                                Sixth 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 collection of 6 cards (featured)",
  "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-04.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": {
          "src": "/placeholders/banner/banner-01.jpg",
          "text": "A super informative description"
        },
        "url": "#",
        "title": "Second 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": {
          "src": "/placeholders/banner/banner-02.jpg",
          "alt": "A super informative description"
        },
        "url": "#",
        "title": "Third 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": {
          "src": "",
          "alt": "A super informative description"
        },
        "url": "#",
        "title": "Fourth 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": {
          "src": "/placeholders/banner/banner-05.jpg",
          "text": "A super informative description"
        },
        "url": "#",
        "title": "Fifth 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": {
          "src": "/placeholders/banner/banner-03.jpg",
          "alt": "A super informative description"
        },
        "url": "#",
        "title": "Sixth 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,
    "featured": true
  }
}