Initial Drupal 11 with DDEV setup
This commit is contained in:
		@ -0,0 +1,39 @@
 | 
			
		||||
{#
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * Theme override for an item list.
 | 
			
		||||
 *
 | 
			
		||||
 * Available variables:
 | 
			
		||||
 * - items: A list of items. Each item contains:
 | 
			
		||||
 *   - attributes: HTML attributes to be applied to each list item.
 | 
			
		||||
 *   - value: The content of the list element.
 | 
			
		||||
 * - title: The title of the list.
 | 
			
		||||
 * - list_type: The tag for list element ("ul" or "ol").
 | 
			
		||||
 * - wrapper_attributes: HTML attributes to be applied to the list wrapper.
 | 
			
		||||
 * - attributes: HTML attributes to be applied to the list.
 | 
			
		||||
 * - empty: A message to display when there are no items. Allowed value is a
 | 
			
		||||
 *   string or render array.
 | 
			
		||||
 * - context: A list of contextual data associated with the list. May contain:
 | 
			
		||||
 *   - list_style: The custom list style.
 | 
			
		||||
 *
 | 
			
		||||
 * @see template_preprocess_item_list()
 | 
			
		||||
 */
 | 
			
		||||
#}
 | 
			
		||||
{% if context.list_style %}
 | 
			
		||||
  {%- set attributes = attributes.addClass('item-list__' ~ context.list_style) %}
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% if items or empty %}
 | 
			
		||||
  {%- if title is not empty -%}
 | 
			
		||||
    <h3>{{ title }}</h3>
 | 
			
		||||
  {%- endif -%}
 | 
			
		||||
 | 
			
		||||
  {%- if items -%}
 | 
			
		||||
    <{{ list_type }}{{ attributes }}>
 | 
			
		||||
      {%- for item in items -%}
 | 
			
		||||
        <li{{ item.attributes }}>{{ item.value }}</li>
 | 
			
		||||
      {%- endfor -%}
 | 
			
		||||
    </{{ list_type }}>
 | 
			
		||||
  {%- else -%}
 | 
			
		||||
    {{- empty -}}
 | 
			
		||||
  {%- endif -%}
 | 
			
		||||
{%- endif %}
 | 
			
		||||
							
								
								
									
										105
									
								
								web/core/themes/stable9/templates/dataset/table.html.twig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										105
									
								
								web/core/themes/stable9/templates/dataset/table.html.twig
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,105 @@
 | 
			
		||||
{#
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * Theme override to display a table.
 | 
			
		||||
 *
 | 
			
		||||
 * Available variables:
 | 
			
		||||
 * - attributes: HTML attributes to apply to the <table> tag.
 | 
			
		||||
 * - caption: A localized string for the <caption> tag.
 | 
			
		||||
 * - colgroups: Column groups. Each group contains the following properties:
 | 
			
		||||
 *   - attributes: HTML attributes to apply to the <col> tag.
 | 
			
		||||
 *     Note: Drupal currently supports only one table header row, see
 | 
			
		||||
 *     https://www.drupal.org/node/893530 and
 | 
			
		||||
 *     http://api.drupal.org/api/drupal/includes!theme.inc/function/theme_table/7#comment-5109.
 | 
			
		||||
 * - header: Table header cells. Each cell contains the following properties:
 | 
			
		||||
 *   - tag: The HTML tag name to use; either 'th' or 'td'.
 | 
			
		||||
 *   - attributes: HTML attributes to apply to the tag.
 | 
			
		||||
 *   - content: A localized string for the title of the column.
 | 
			
		||||
 *   - field: Field name (required for column sorting).
 | 
			
		||||
 *   - sort: Default sort order for this column ("asc" or "desc").
 | 
			
		||||
 * - sticky: A flag indicating whether to use a "sticky" table header.
 | 
			
		||||
 * - rows: Table rows. Each row contains the following properties:
 | 
			
		||||
 *   - attributes: HTML attributes to apply to the <tr> tag.
 | 
			
		||||
 *   - data: Table cells.
 | 
			
		||||
 *   - no_striping: A flag indicating that the row should receive no
 | 
			
		||||
 *     'even / odd' styling. Defaults to FALSE.
 | 
			
		||||
 *   - cells: Table cells of the row. Each cell contains the following keys:
 | 
			
		||||
 *     - tag: The HTML tag name to use; either 'th' or 'td'.
 | 
			
		||||
 *     - attributes: Any HTML attributes, such as "colspan", to apply to the
 | 
			
		||||
 *       table cell.
 | 
			
		||||
 *     - content: The string to display in the table cell.
 | 
			
		||||
 *     - active_table_sort: A boolean indicating whether the cell is the active
 | 
			
		||||
         table sort.
 | 
			
		||||
 *     - header: Boolean indicating whether the cell should be rendered as a
 | 
			
		||||
 *       header (<th>) or not (<td>).
 | 
			
		||||
 * - footer: Table footer rows, in the same format as the rows variable.
 | 
			
		||||
 * - empty: The message to display in an extra row if table does not have
 | 
			
		||||
 *   any rows.
 | 
			
		||||
 * - no_striping: A boolean indicating that the row should receive no striping.
 | 
			
		||||
 * - header_columns: The number of columns in the header.
 | 
			
		||||
 *
 | 
			
		||||
 * @see template_preprocess_table()
 | 
			
		||||
 */
 | 
			
		||||
#}
 | 
			
		||||
<table{{ attributes }}>
 | 
			
		||||
  {% if caption %}
 | 
			
		||||
    <caption>{{ caption }}</caption>
 | 
			
		||||
  {% endif %}
 | 
			
		||||
 | 
			
		||||
  {% for colgroup in colgroups %}
 | 
			
		||||
    {% if colgroup.cols %}
 | 
			
		||||
      <colgroup{{ colgroup.attributes }}>
 | 
			
		||||
        {% for col in colgroup.cols %}
 | 
			
		||||
          <col{{ col.attributes }} />
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
      </colgroup>
 | 
			
		||||
    {% else %}
 | 
			
		||||
      <colgroup{{ colgroup.attributes }} />
 | 
			
		||||
    {% endif %}
 | 
			
		||||
  {% endfor %}
 | 
			
		||||
 | 
			
		||||
  {% if header %}
 | 
			
		||||
    <thead>
 | 
			
		||||
      <tr>
 | 
			
		||||
        {% for cell in header %}
 | 
			
		||||
          <{{ cell.tag }}{{ cell.attributes }}>
 | 
			
		||||
            {{- cell.content -}}
 | 
			
		||||
          </{{ cell.tag }}>
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
      </tr>
 | 
			
		||||
    </thead>
 | 
			
		||||
  {% endif %}
 | 
			
		||||
 | 
			
		||||
  {% if rows %}
 | 
			
		||||
    <tbody>
 | 
			
		||||
      {% for row in rows %}
 | 
			
		||||
        <tr{{ row.attributes }}>
 | 
			
		||||
          {% for cell in row.cells %}
 | 
			
		||||
            <{{ cell.tag }}{{ cell.attributes }}>
 | 
			
		||||
              {{- cell.content -}}
 | 
			
		||||
            </{{ cell.tag }}>
 | 
			
		||||
          {% endfor %}
 | 
			
		||||
        </tr>
 | 
			
		||||
      {% endfor %}
 | 
			
		||||
    </tbody>
 | 
			
		||||
  {% elseif empty %}
 | 
			
		||||
    <tbody>
 | 
			
		||||
      <tr>
 | 
			
		||||
        <td colspan="{{ header_columns }}">{{ empty }}</td>
 | 
			
		||||
      </tr>
 | 
			
		||||
    </tbody>
 | 
			
		||||
  {% endif %}
 | 
			
		||||
  {% if footer %}
 | 
			
		||||
    <tfoot>
 | 
			
		||||
      {% for row in footer %}
 | 
			
		||||
        <tr{{ row.attributes }}>
 | 
			
		||||
          {% for cell in row.cells %}
 | 
			
		||||
            <{{ cell.tag }}{{ cell.attributes }}>
 | 
			
		||||
              {{- cell.content -}}
 | 
			
		||||
            </{{ cell.tag }}>
 | 
			
		||||
          {% endfor %}
 | 
			
		||||
        </tr>
 | 
			
		||||
      {% endfor %}
 | 
			
		||||
    </tfoot>
 | 
			
		||||
  {% endif %}
 | 
			
		||||
</table>
 | 
			
		||||
		Reference in New Issue
	
	Block a user