Inhaltsverzeichnis

Views Theming

Views Templates

Explanation taken from: https://redcrackle.com/blog/drupal-8/theme-views-templates

Views default templates are located under „/core/modules/views/templates/“ folder.

Each view uses minimum of two templates:

Override Views Templates

Each type of the view templates above can be overridden with a variety of names. The template name is a concatenation of (base template name, view machine name, view display type and view display id - separated by 2 hyphens „–“).

The following are the possible template names sorted by precedence:

For example; If we want to override „views-view.html.twig“ template for our view, the following template names are valid:

Fields

Views View Grid

views-view-grid.css
.grid-container {
  /**
   * User input values.
   */
  --grid-layout-gap: 10px;
  --grid-column-count: 4;
  --grid-item--min-width: 100px;
 
  /**
   * Calculated values.
   */
  --gap-count: calc(var(--grid-column-count) - 1);
  --total-gap-width: calc(var(--gap-count) * var(--grid-layout-gap));
  --grid-item--max-width: calc((100% - var(--total-gap-width)) / var(--grid-column-count));
 
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(var(--grid-item--min-width), var(--grid-item--max-width)), 1fr));
  grid-gap: var(--grid-layout-gap);
}

Seiten in diesem Segment


Backlinks zu dieser Seite: