function template_preprocess_aggregator_summary_item

Processes variables for aggregator summary item templates.

Default template: aggregator-summary-item.html.twig.

Parameters

array $variables: An associative array containing:

  • aggregator_item: The feed item.
  • view_mode: How the item is being displayed.

File

drupal/core/modules/aggregator/aggregator.pages.inc, line 518
User page callbacks for the Aggregator module.

Code

function template_preprocess_aggregator_summary_item(&$variables) {
  $item = $variables['aggregator_item'];
  $variables['item_url'] = l(check_plain($item
    ->label()), check_url(url($item->link->value, array(
    'absolute' => TRUE,
  ))), array(
    'attributes' => array(
      'class' => array(
        'feed-item-url',
      ),
    ),
  ));
  $variables['item_age'] = theme('datetime', array(
    'attributes' => array(
      'datetime' => format_date($item->timestamp->value, 'html_datetime', '', 'UTC'),
      'class' => array(
        'feed-item-age',
      ),
    ),
    'text' => t('%age old', array(
      '%age' => format_interval(REQUEST_TIME - $item->timestamp->value),
    )),
    'html' => TRUE,
  ));
}