Aggregator item

Some extra's for aggregator-item components.

Extra template suggestions

Added a more specific template suggestion depending on the name of the feed the aggregator-item is from.

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'aggregator_item' -->
<!-- FILE NAME SUGGESTIONS:
   X aggregator-item--wikipedia.html.twig
   * aggregator-item.html.twig
-->

In above example:

  • wikipedia is the name of the feed.

Better classes

The classes on aggregator-items has been changed to:

{%
  set classes = [
    'aggregator-item',
    feed ? 'aggregator-item--' ~ feed|clean_class,
  ]
%}

Which gives you the following classes:

.aggregator-item {}
.aggregator-item--wikipedia {}

Making more variables available in Twig

Aggregator items are not exposed in Drupal's Field UI, therefor it's tricky to reach the right variables. In this component 2 variables have been added that are available in the template:

  • {{ feed }} can be used to show the name of the feed.
  • {{ adapted_time }} can be used to show the aggregator-item was last updated.

Specifications

Machine name

aggregator-item

Built upon

Drupal Core

Perks

Responsive
Accessible

Building blocks

HTML

Stats

Public component
13 downloads
No open issue

Contributors