On Github criz / drupal8-theming
<div id="BAD-PRACTICE">...</div>
name: THEME-NAME description: 'A short description for the theme.' package: Custom type: theme version: 1.0 core: 8.xDatei: THEME-NAME.info.yml
regions: header: 'Header' content: 'Content' sidebar_first: 'Sidebar first' sidebar_second: 'Sidebar second' footer: 'Footer' regions_hidden: - sidebar_firstDatei: THEME-NAME.info.yml
stylesheets: all: - css/base.css - css/layout.css - css/components.css print: - css/print.cssDatei: THEME-NAME.info.yml
# Overwrite a CSS file: stylesheets-overwrite: - normalize.css # Remove a CSS file: stylesheets-remove: - normalize.cssDatei: THEME-NAME.info.ymlChange record: https://www.drupal.org/node/1876600
base: version: 1.x js: js/custom.js: {} dependencies: - core/drupal - core/jquery - core/jquery.onceDatei: THEME-NAME.libraries.yml
libraries: - THEME-NAME/baseDatei: 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/jqueryDatei: THEME-NAME.libraries.yml
libraries: - THEME-NAME/flexsliderDatei: 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.xDatei: 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: falseDatei: services.yml
$ npm i -g eslint
$ eslint .
$ npm install -g csslint
$ csslint .
.block__element--modifier
<div class="contact contact--small"> <div class="contact__title">TITLE</div> <div class="contact__form">...</div> </div>
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 %} <div>{{ foo }}</div> {% endif %}Wir brauchen "is_defined" nicht.
{% for item in navigation %} <li><a href="{{ item.href }}">{{ item.caption }}</a></li> {% endfor %}oder
{% for value, key in items %} <div class="{{ key }}">{{ value }}</div> {% endfor %}Bei zweitem Loop wollen wir key und value ausgeben.
{{ loop.length }} {{ loop.first}} {{ loop.last }} {{ loop.index }}
{% if loop.first %} ... {% elseif loop.index == 2 %} ... {% elseif loop.last %} ... {% endif %}Volle Kontrolle über die Position der Values in der Schleife.
{% set foo=“BAR” %} {{ foo }}Gibt "BAR" aus.
{% trans %} Submitted by {{ author_name|passthrough }} on {{ date|passthrough }} {% endtrans %}