The reference screen is a split screen view of two documents side-by-side. It helps users to find information across multiple documents.
Example
The following is an example configuration for reference screens:
Code Block | ||
---|---|---|
| ||
{
"ref_types": [
{
"icon": "lightbulb",
"ref_type": "reference2",
"subtypes": [
{
"query": "scrum",
"ref_type": "reference2.mentions",
"title": "Mentions"
},
{
"query": "scrum",
"ref_type": "reference2.mentions2",
"title": "More mentions"
}
],
"title": "Reference Documents"
},
{
"available": "true",
"icon": "translate",
"query": "scrum guide czech",
"ref_item_title": "\n{% if \"original\" in ref_item.keywords.translation %}\n Original in {{ lang.get_name(ref_item.language) }}\n {% else %}\n Translated from {{ lang.get_name(item.language) }} to {{ lang.get_name(ref_item.language) }}\n {% endif %}\n",
"ref_type": "translation",
"title": "Translation"
}
]
} |
The reference screen is accessed when clicking on the icon on a card that was defined in the reference configuration.
...
Example of reference screen detail view:
...
Configuration Reference
Reference Types
Top level array holding the individual reference type objects.
...
Only used if present and no subtypes are specified. Reference item specific (overrides title
) to be displayed above reference item. Interpreted as Jinja2 template.
Accessible variables and functions:
...
`item` - the currently viewed item
...
`ref_item` - the referenced item
...
fields available in `item` and `ref_item`:
...
item.created_at
...
item.external_id
...
...
item.keywords
...
item.language
...
item.link
...
item.title
...
`lang.get_name(item.language)` - get a human readable language name based on ISO 639-1 code
query
type: string
Required if no subtypes are specified. Squirro search query used to return reference items for particular item. Interpreted as Jinja2 template.
Accessible variables and functions:
...
item
- the currently viewed item
...
ref_item
- the referenced item
...
fields available in
item
and ref_item
:
...
item.created_at
...
item.external_id
...
...
item.keywords
...
item.language
...
item.link
...
item.title
...
lang.get_name(item.language)
- get a human readable language name based on ISO 639-1 code
available
type: string
Optional dynamic field value based on item
. Interpreted as Jinja2 template.
Value interpretation:
...
true
- reference item are accessible and Icon on search page is active
...
false
- reference item are not present and Icon on search page is disabled
...
null
or other value - unknown state, Icon stays active on search page - same as if available
field was not specified.
Accessible variables and functions
...
item.created_at
...
item.external_id
...
...
item.keywords
...
item.language
...
item.link
...
item.title
Reference Subtypes
subtypes
...
List of reference subtypes if any.
Reference Subtype Object
ref_type
...
Accessible variables and functions:
...
item
- the currently viewed item
...
ref_item
- the referenced item
...
fields available in
item
and ref_item
:
...
item.created_at
...
item.external_id
...
...
item.keywords
...
item.language
...
item.link
...
item.title
...
lang.get_name(item.language)
- get a human readable language name based on ISO 639-1 code
query
Required
type: string
Squirro search query used to return reference items for particular item. Required if no subtypes are specified. Interpreted as Jinja2 template.
Accessible variables and functions:
...
item
- the currently viewed item
...
ref_item
- the referenced item
...
fields available in
item
and ref_item
:
...
item.created_at
...
item.external_id
...
...
item.keywords
...
item.language
...
item.link
...
item.title
...
lang.get_name(item.language)
- get a human readable language name based on ISO 639-1
...
Example
The following is an example configuration for reference screens:
code
...
language | json |
---|
...
{
"ref_types": [
{
"icon": "lightbulb",
"ref_type": "reference2",
"subtypes": [
{
"query": "scrum",
"ref_type": "reference2.mentions",
"title": "Mentions"
},
{
"query": "scrum",
"ref_type": "reference2.mentions2",
"title": "More mentions"
}
],
"title": "Reference Documents"
},
{
"available": "true",
"icon": "translate",
"query": "scrum guide czech",
"ref_item_title": "\n{% if \"original\" in ref_item.keywords.translation %}\n Original in {{ lang.get_name(ref_item.language) }}\n {% else %}\n Translated from {{ lang.get_name(item.language) }} to {{ lang.get_name(ref_item.language) }}\n {% endif %}\n",
"ref_type": "translation",
"title": "Translation"
}
]
}
The reference screen is accessed when clicking on the icon on a card that was defined in the reference configuration.
...
Example of reference screen detail view:
...