2024-08-09 17:04:53 +02:00
|
|
|
|
{#
|
|
|
|
|
/**
|
|
|
|
|
* @file
|
|
|
|
|
* Default theme implementation for a single field in a view.
|
|
|
|
|
*
|
|
|
|
|
* Available variables:
|
|
|
|
|
* - view: The view that the field belongs to.
|
|
|
|
|
* - field: The field handler that can process the input.
|
|
|
|
|
* - row: The raw result of the database query that generated this field.
|
|
|
|
|
* - output: The processed output that will normally be used.
|
|
|
|
|
*
|
|
|
|
|
* When fetching output from the row this construct should be used:
|
|
|
|
|
* data = row[field.field_alias]
|
|
|
|
|
*
|
|
|
|
|
* The above will guarantee that you'll always get the correct data, regardless
|
|
|
|
|
* of any changes in the aliasing that might happen if the view is modified.
|
|
|
|
|
*
|
|
|
|
|
* @see template_preprocess_views_view_field()
|
|
|
|
|
*
|
|
|
|
|
* @ingroup themeable
|
|
|
|
|
*/
|
|
|
|
|
#}
|
2024-11-25 22:02:41 +01:00
|
|
|
|
{% if output|length == 5
|
2024-10-11 16:33:41 +02:00
|
|
|
|
and output|replace(
|
|
|
|
|
{'0':'', '1':'', '2':'', '3':'', '4':'', '5':'', '6':'', '7':'', '8':'', '9':''}
|
2024-11-25 22:02:41 +01:00
|
|
|
|
) == ''
|
2024-10-11 16:33:41 +02:00
|
|
|
|
%}
|
|
|
|
|
<p>{{- output|slice(0, 2) -}}</p>
|
|
|
|
|
{% else %}
|
2024-11-25 22:02:41 +01:00
|
|
|
|
{% set split_output = output|split('>') %}
|
|
|
|
|
<p>
|
2024-11-25 23:19:34 +01:00
|
|
|
|
{% if split_output|length == 7 %}
|
|
|
|
|
{{- output -}}
|
|
|
|
|
{% else %}
|
|
|
|
|
{{- split_output[0]|raw -}}>
|
|
|
|
|
{# non breaking hyphen #}
|
|
|
|
|
{{- split_output[1]|default('')|replace({'-': '‑'})|raw -}}>
|
|
|
|
|
{% endif %}
|
2024-11-25 22:02:41 +01:00
|
|
|
|
</p>
|
2024-10-11 16:33:41 +02:00
|
|
|
|
{% endif %}
|