{# This template is also rendered with each entry (i.e., `rendered_templates`), and has access to all of the main entry-specific template values. Since the goal is definitions, `lexicon_entry` is relevant. Filtering by target language has to happen here, so be sure to use the `xml_lang` filter if overriding. #} {% block template_doc %}{% if TEMPLATE_DOC %} Customizations include: - audio links - via SoundManager2 and some custom JS (see includes.template) - sorting by @rank attribute {% endif %}{% endblock %} {% import 'lexicon.macros' as macros with context %} {% for meaning_group in lexicon_entry|xpath('./mg') %} {% set translation_groups = meaning_group|xpath('./tg')|xml_lang(_to) %} {% if translation_groups|count > 0 %}
{% for example in examples %} {% if example|xpath('@re') %}
{# example-audio #} {% for example in examples %} {% set has_audio = example|xpath('./audio')|length > 0 %} {%- if has_audio -%} {%- set audio = example|xpath('./audio/a') %} {%- endif -%} {% endfor %} {# /example-audio #}- {{ example|xpath('./x')|first|text }} ({{ example|xpath('@re')|first }})
{% else %}- {{ example|xpath('./x')|first|text }}
{% endif %}- {{ example|xpath('./xt')|first|text }}
{% endfor %}