diff --git a/app/Drupal/laszlo/components/content/search-result/search-result.component.yml b/app/Drupal/laszlo/components/content/search-result/search-result.component.yml
index 016d0844..a39bdc3b 100644
--- a/app/Drupal/laszlo/components/content/search-result/search-result.component.yml
+++ b/app/Drupal/laszlo/components/content/search-result/search-result.component.yml
@@ -12,5 +12,5 @@ props:
type: string
description: The URL of the search result.
excerpt:
- type: [string, array]
+ type: [string, array, 'null']
description: The excerpt of the search result.
diff --git a/app/Drupal/laszlo/components/content/search-result/search-result.twig b/app/Drupal/laszlo/components/content/search-result/search-result.twig
index fab681ce..85c19d50 100644
--- a/app/Drupal/laszlo/components/content/search-result/search-result.twig
+++ b/app/Drupal/laszlo/components/content/search-result/search-result.twig
@@ -2,7 +2,9 @@
-
- {{ excerpt }}
-
+ {% if excerpt %}
+
+ {{ excerpt }}
+
+ {% endif %}
\ No newline at end of file
diff --git a/app/Drupal/laszlo/src/Hook/Theme/PreprocessTaxonomyTerm.php b/app/Drupal/laszlo/src/Hook/Theme/PreprocessTaxonomyTerm.php
index 294dc047..69b18b2a 100644
--- a/app/Drupal/laszlo/src/Hook/Theme/PreprocessTaxonomyTerm.php
+++ b/app/Drupal/laszlo/src/Hook/Theme/PreprocessTaxonomyTerm.php
@@ -22,10 +22,16 @@ public static function create(ContainerInterface $container): self {
);
}
+ private function addCommonVariables(TermInterface $term, array &$variables): void {
+ $variables['url_absolute'] = $term->toUrl()->setAbsolute()->toString();
+ }
+
public function __invoke(array &$variables): void {
$term = $variables['term'];
\assert($term instanceof TermInterface);
+ $this->addCommonVariables($term, $variables);
+
$class = match ($term->bundle()) {
default => NULL,
'tags' => PreprocessTaxonomyTermTags::class,
diff --git a/app/Drupal/laszlo/templates/content/taxonomy-term/tags/taxonomy-term--tags--search-result.html.twig b/app/Drupal/laszlo/templates/content/taxonomy-term/tags/taxonomy-term--tags--search-result.html.twig
new file mode 100644
index 00000000..368a73f5
--- /dev/null
+++ b/app/Drupal/laszlo/templates/content/taxonomy-term/tags/taxonomy-term--tags--search-result.html.twig
@@ -0,0 +1,4 @@
+{% include 'laszlo:search-result' with {
+ title: term.label(),
+ url: url_absolute,
+} only %}
\ No newline at end of file
diff --git a/app/Drupal/niklan/src/Search/Controller/Search.php b/app/Drupal/niklan/src/Search/Controller/Search.php
index fb474381..3fcca096 100644
--- a/app/Drupal/niklan/src/Search/Controller/Search.php
+++ b/app/Drupal/niklan/src/Search/Controller/Search.php
@@ -82,6 +82,10 @@ public function __invoke(Request $request): array {
'#query' => $query,
'#pager' => ['#type' => 'pager', '#quantity' => 5],
'#cache' => [
+ 'contexts' => [
+ 'url.query_args:q',
+ 'url.query_args.pagers:0',
+ ],
'tags' => [
'search_api_list:global_index',
],