...
name: THEME-NAME
description: 'A short description for the theme.'
package: Custom
type: theme
version: 1.0
core: 8.x
Datei: THEME-NAME.info.yml
regions:
header: 'Header'
content: 'Content'
sidebar_first: 'Sidebar first'
sidebar_second: 'Sidebar second'
footer: 'Footer'
regions_hidden:
- sidebar_first
Datei: THEME-NAME.info.yml
stylesheets:
all:
- css/base.css
- css/layout.css
- css/components.css
print:
- css/print.css
Datei: THEME-NAME.info.yml
# Overwrite a CSS file:
stylesheets-overwrite:
- normalize.css
# Remove a CSS file:
stylesheets-remove:
- normalize.css
Datei: THEME-NAME.info.yml
base:
version: 1.x
js:
js/custom.js: {}
dependencies:
- core/drupal
- core/jquery
- core/jquery.once
Datei: THEME-NAME.libraries.yml
libraries:
- THEME-NAME/base
Datei: THEME-NAME.info.yml
flexslider:
version: 2.2.2
license:
name: gpl2
url: http://www.gnu.org/licenses/gpl-2.0.html
gpl-compatible: true
remote: https://github.com/woothemes/FlexSlider
js:
lib/flexslider/js/jquery.flexslider-min.js: {}
css:
theme:
lib/flexslider/css/flexslider.css: {}
dependencies:
- core/jquery
Datei: THEME-NAME.libraries.yml
libraries:
- THEME-NAME/flexslider
Datei: THEME-NAME.info.yml
name: THEME-NAME
description: 'An awesome D8 theme based on classy.'
base theme: classy
package: Custom
type: theme
version: 1.0
core: 8.x
Datei: THEME-NAME.info.yml
THEME-NAME.mobile:
label: mobile
mediaQuery: '(min-width: 0px)'
weight: 0
multipliers:
- 1x
THEME-NAME.narrow:
label: narrow
mediaQuery: 'all and (min-width: 480px) and (max-width: 959px)'
weight: 1
multipliers:
- 1x
- 1.5x
- 2x // For mac retina displays.
Datei: THEME-NAME.breakpoints.yml
uuid: 4dacc686-1f91-48af-bb01-1c765f5410a1
langcode: en
status: true
dependencies: { }
name: slider_mobile
label: 'Slider mobile'
effects:
6d437f0f-0ff1-4736-9537-55e26f9ec57d:
uuid: 6d437f0f-0ff1-4736-9537-55e26f9ec57d
id: image_scale
weight: 1
data:
width: 480
height: null
upscale: false
third_party_settings: { }
Datei image.style.slider_mobile.yml
#if (file_exists(__DIR__ . '/settings.local.php')) {
# include __DIR__ . '/settings.local.php';
#}
$ drush dl devel
$ drush en devel
$ drush en kint
{{ kint($data); }}
parameters:
twig.config:
debug: true
auto_reload: true
twig_cache: false
Datei: services.yml
$ npm i -g eslint
$ eslint .
$ npm install -g csslint
$ csslint .
.block__element--modifier
TITLE
...
db_query('DROP TABLE {users}');
{{ VARIABLE }}
{# COMMENT #}
{{ items.first.href }}
{{ items.second.nid }}
{{ VARIABLE|filter }}
Wie zB t() für Übersetzungen:
{{ String|t }}
{% if foo %}
{{ foo }}
{% endif %}
{% for item in navigation %}
{{ item.caption }}
{% endfor %}
oder
{% for value, key in items %}
{{ value }}
{% endfor %}
{{ loop.length }}
{{ loop.first}}
{{ loop.last }}
{{ loop.index }}
{% if loop.first %}
...
{% elseif loop.index == 2 %}
...
{% elseif loop.last %}
...
{% endif %}
{% set foo=“BAR” %}
{{ foo }}
Gibt "BAR" aus.
{% trans %}
Submitted by {{ author_name|passthrough }}
on {{ date|passthrough }}
{% endtrans %}