Commit 75c5d9f5 authored by Steve De Jonghe's avatar Steve De Jonghe Committed by Thomas Seidl
Browse files

Issue #3217772 by seutje, vector_ray, drunken monkey, Marios Anagnostopoulos:...

Issue #3217772 by seutje, vector_ray, drunken monkey, Marios Anagnostopoulos: Added a template for the excerpt field.
parent 42d2f7a5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
Search API 1.x, dev (xxxx-xx-xx):
---------------------------------
- #3217772 by seutje, vector_ray, drunken monkey, Marios Anagnostopoulos: Added
  a template for the excerpt field.

Search API 1.29 (2023-03-27):
-----------------------------
+10 −2
Original line number Diff line number Diff line
@@ -345,6 +345,11 @@ function search_api_theme() {
        'table' => NULL,
      ],
    ],
    'search_api_excerpt' => [
      'variables' => [
        'excerpt' => NULL,
      ],
    ],
  ];
}

@@ -656,8 +661,11 @@ function search_api_entity_view(array &$build, EntityInterface $entity, EntityVi
  $excerpt_component = $display->getComponent('search_api_excerpt');
  if ($excerpt_component !== NULL && isset($build['#search_api_excerpt'])) {
    $build['search_api_excerpt'] = [
      '#theme' => 'search_api_excerpt',
      '#excerpt' => [
        '#type' => 'markup',
        '#markup' => $build['#search_api_excerpt'],
      ],
      '#cache' => [
        'contexts' => ['url.query_args'],
      ],
+14 −0
Original line number Diff line number Diff line
{#
/**
 * @file
 * Default theme implementation for displaying a search excerpt.
 *
 * Available variables:
 * - excerpt: The search excerpt.
 *
 * @ingroup themeable
 */
#}
<div class="field field--search-api-excerpt">
  {{ excerpt }}
</div>