From 513fa8a01be8660121a5cce75991beb06839ba58 Mon Sep 17 00:00:00 2001 From: rdrew Date: Mon, 12 May 2025 16:05:29 -0300 Subject: [PATCH] added scholar field --- ...--field-media-document--document.html.twig | 81 +++++++++++++++++++ templates/layout/page--user.html.twig | 3 +- .../taxonomy-term--scholars.html.twig | 4 +- vre2024.theme | 4 + 4 files changed, 89 insertions(+), 3 deletions(-) create mode 100755 templates/field/field--media--field-media-document--document.html.twig diff --git a/templates/field/field--media--field-media-document--document.html.twig b/templates/field/field--media--field-media-document--document.html.twig new file mode 100755 index 0000000..291efa9 --- /dev/null +++ b/templates/field/field--media--field-media-document--document.html.twig @@ -0,0 +1,81 @@ +{# +/** + * @file + * Theme override for a field. + * + * To override output, copy the "field.html.twig" from the templates directory + * to your theme's directory and customize it, just like customizing other + * Drupal templates such as page.html.twig or node.html.twig. + * + * Instead of overriding the theming for all fields, you can also just override + * theming for a subset of fields using + * @link themeable Theme hook suggestions. @endlink For example, + * here are some theme hook suggestions that can be used for a field_foo field + * on an article node type: + * - field--node--field-foo--article.html.twig + * - field--node--field-foo.html.twig + * - field--node--article.html.twig + * - field--field-foo.html.twig + * - field--text-with-summary.html.twig + * - field.html.twig + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - label_hidden: Whether to show the field label or not. + * - title_attributes: HTML attributes for the title. + * - label: The label for the field. + * - multiple: TRUE if a field can contain multiple items. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item's content. + * - entity_type: The entity type to which the field belongs. + * - field_name: The name of the field. + * - field_type: The type of the field. + * - label_display: The display settings for the label. + * + * + * @see template_preprocess_field() + */ +#} + +{% + set classes = [ + 'field', + 'field--name-' ~ field_name|clean_class, + 'field--type-' ~ field_type|clean_class, + 'field--label-' ~ label_display, + ] +%} +{% + set title_classes = [ + 'field__label', + label_display == 'visually_hidden' ? 'visually-hidden', + ] +%} + +{% if label_hidden %} + {% if multiple %} + + {% for item in items %} + {{ item.content }} + {% endfor %} + + {% else %} + {% for item in items %} + {{ item.content }} + {% endfor %} + {% endif %} +{% else %} + + {{ label }} + {% if multiple %} +
+ {% endif %} + {% for item in items %} + {{ item.content }}
+ {% endfor %} + {% if multiple %} + + {% endif %} + +{% endif %} diff --git a/templates/layout/page--user.html.twig b/templates/layout/page--user.html.twig index 9b4eae7..060eedb 100755 --- a/templates/layout/page--user.html.twig +++ b/templates/layout/page--user.html.twig @@ -10,8 +10,7 @@ {% endif %} - {# {{ dump(_context) }} #} - + {# {{ dump(_context) }} #} {% set scholar_name = page['#title'] %}
diff --git a/templates/main_layouts/taxonomy-term--scholars.html.twig b/templates/main_layouts/taxonomy-term--scholars.html.twig index 824bad5..b3abe5e 100755 --- a/templates/main_layouts/taxonomy-term--scholars.html.twig +++ b/templates/main_layouts/taxonomy-term--scholars.html.twig @@ -44,7 +44,8 @@ content.field_google_scholar_id, content.field_status, content.field_fields_of_activity, - content.field_upei_identifier_u1 + content.field_upei_identifier_u1, + content.field_supervisory_availability ] %}
@@ -68,6 +69,7 @@ {{ content.field_google_scholar_id }} {{ content.field_status }} {{ content.field_upei_identifier_u1 }} + {{ content.field_supervisory_availability }}
diff --git a/vre2024.theme b/vre2024.theme index d401bff..c663c64 100755 --- a/vre2024.theme +++ b/vre2024.theme @@ -32,3 +32,7 @@ function vre2024_preprocess_breadcrumb(&$variables) { function vre2024_preprocess_html(&$variables) { $variables['is_front'] = \Drupal::service('path.matcher')->isFrontPage(); } +function vre2024_field_widget_info_alter(&$info) { + $info['text_textarea']['field_types'][] = 'text'; + $info['string_textarea']['field_types'][] = 'string'; +}