summaryrefslogtreecommitdiff
path: root/docs/dev/result_types/infobox.rst
blob: a017015a7b5d7ae221cd28b7b81fee901d982bd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.. _result_types.infobox:

===============
Infobox Results
===============

.. hint::

   There is still no typing for these result items. The templates can be used as
   orientation until the final typing is complete.

The :ref:`area info box` is an area where addtional infos shown to the user.

Fields used in the :origin:`infobox.html
<searx/templates/simple/elements/infobox.html>`:

img_src: :py:class:`str`
  URL of a image or thumbnail that is displayed in the infobox.

infobox: :py:class:`str`
  Title of the info box.

content: :py:class:`str`
  Text of the info box.

The infobox has additional subsections for *attributes*, *urls* and
*relatedTopics*:

attributes: :py:class:`List <list>`\ [\ :py:class:`dict`\ ]
  A list of attributes.  An *attribute* is a dictionary with keys:

  - label :py:class:`str`: (mandatory)

  - value :py:class:`str`: (mandatory)

  - image :py:class:`List <list>`\ [\ :py:class:`dict`\ ] (optional)

    A list of images.  An *image* is a dictionary with keys:

    - src :py:class:`str`: URL of an image/thumbnail (mandatory)
    - alt :py:class:`str`: alternative text for the image (mandatory)

urls: :py:class:`List <list>`\ [\ :py:class:`dict`\ ]
  A list of links.  An *link* is a dictionary with keys:

  - url :py:class:`str`: URL of the link (mandatory)
  - title :py:class:`str`: Title of the link (mandatory)

relatedTopics: :py:class:`List <list>`\ [\ :py:class:`dict`\ ]
  A list of topics.  An *topic* is a dictionary with keys:

  - name: :py:class:`str`: (mandatory)

  - suggestions: :py:class:`List <list>`\ [\ :py:class:`dict`\ ] (optional)

    A list of suggestions.  A *suggestion* is simple dictionary with just one
    key/value pair:

    - suggestion: :py:class:`str`: suggested search term (mandatory)