search-results

Information

Folder
src/components/template-components/search-results

Files

Schema
// src/components/template-components/search-results/schema.yaml

$schema: http://json-schema.org/draft-07/schema
$id: /template-components/search-results
additionalProperties: false
type: object
properties:
  items:
    type: string
    format: html
    description: template-components/search-results/result
Mocks
// src/components/template-components/search-results/mocks.yaml

items:
  $render:
    - $tpl: template-components/search-results/result
      $ref: template-components/search-results/result
    - $tpl: template-components/search-results/result
      $ref: template-components/search-results/result#with-info
    - $tpl: template-components/search-results/result
      $ref: template-components/search-results/result#with-snippet
    - $tpl: template-components/search-results/result
      $ref: template-components/search-results/result#with-snippet-and-info
Template
// src/components/template-components/search-results/search-results.twig

{{ attach_library("circle_dot/template-components-search-results") }}
<div class="SearchResults">
	{% if items %}
		<ol class="SearchResults-list">
			{{ items }}
		</ol>
	{% else %}
		<p>{{ "No search results."|t }}</p>
	{% endif %}
</div>

Variants

default
Open
  1. This is a search result with info

    Nostrud fugiat nostrud nostrud dolore ea commodo nulla.

  2. This is a search result with a snippet

    Eu nulla quis est do aliquip exercitation culpa duis nisi voluptate culpa.

  3. This is a search result with a snippet and info

    Pariatur elit ea ex ipsum qui fugiat dolor proident anim.

    Amet ad do sit incididunt occaecat non exercitation dolore sunt ut nulla consectetur.