Skip to content

Commit

Permalink
release(2.25.0): fix obblighi di pubblicazione list view
Browse files Browse the repository at this point in the history
  • Loading branch information
arturu committed Jan 14, 2025
1 parent f969505 commit 016535c
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{#
/**
* @file
* Default theme implementation to display a taxonomy term.
*
* Available variables:
* - url: URL of the current term.
* - name: (optional) Name of the current term.
* - content: Items for the content of the term (fields and description).
* Use 'content' to print them all, or print a subset such as
* 'content.description'. Use the following code to exclude the
* printing of a given child element:
* @code
* {{ content|without('description') }}
* @endcode
* - attributes: HTML attributes for the wrapper.
* - page: Flag for the full page state.
* - term: The taxonomy term entity, including:
* - id: The ID of the taxonomy term.
* - bundle: Machine name of the current vocabulary.
* - view_mode: View mode, e.g. 'full', 'teaser', etc.
*
* @see template_preprocess_taxonomy_term()
*
* @ingroup themeable
*/
#}
{% apply spaceless %}
{% include '@bi-bcl/list/list-item.html.twig' with {
list_url: url,
list_text: name,
list_icon: 'icon-bookmark-solid',
list_show_end_arrow: true,
list_item_attributes: attributes.setAttribute('title', 'Vai alla sezione ' ~ name|render|striptags|trim),
color: 'greendark'
} %}
{% endapply %}
{#<div{{ attributes }}>#}
{# {{ title_prefix }}#}
{# {% if name and not page %}#}
{# <a class="" href="{{ url }}" title="{{ 'Vai alla sezione ' ~ name|render|striptags|trim }}">#}
{# {{ name }}#}
{# </a>#}
{# {% endif %}#}
{# {{ title_suffix }}#}
{# {{ content }}#}
{#</div>#}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{#
/**
* @file
* Default theme implementation for a field with ul.
*
* 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.
* - field_container_vertical_padding: Automatic vertical padding.
* - field_container_vertical_margin: Automatic vertical margin.
* - field_label_tag: choose label tag, default('div').
* - field_view_mode: View mode.
*
* @see template_preprocess_field()
*
* @ingroup themeable
*/
#}
{% apply spaceless %}

{% set container_classes = [
'field',
'field--type-' ~ field_type|clean_class,
'field--name-' ~ field_name|clean_class,
'field--entity-' ~ entity_type|clean_class,
multiple ? 'field-multiple',
'field--label-' ~ label_display|clean_class,
field_view_mode ? 'field--view-mode-' ~ field_view_mode|clean_class,
'my-5'
] %}

<div{{ attributes.addClass(container_classes) }}>
{% include '@bi-field/_partial.field-label.html.twig' with {
field_label_tag: 'h3',
field_label_bold: false,
field_label_separator: '',
title_attributes: title_attributes.addClass(['h5', 'fw-lighter', 'mb-2'])
} %}

{% embed '@bi-bcl/list/list.html.twig'%}
{% block listItems %}
{% for item in items %}
{{ item.content }}
{% endfor %}
{% endblock %}
{% endembed %}

</div>{# End main container. #}
{% endapply %}

0 comments on commit 016535c

Please sign in to comment.